MediaStreamRecorder icon indicating copy to clipboard operation
MediaStreamRecorder copied to clipboard

How to Save Recorded Audio into Folder

Open HatimSaif opened this issue 8 years ago • 1 comments

Hello,

I am facing problem how can i save audio file in to specific folder, Actually this plugin record audio perfectly but i dont know how to save audio in to specific folder

Please help

HatimSaif avatar Feb 06 '17 21:02 HatimSaif

'''Dear all, correct me when I'm wrong. It also helps me a lot.'''

Hi, @HatimSaif

At first, I guess it's not an issue on this project.

if you want to save it simply under ~/Downloads

recorder.ondataavailable = (blob) => {
  var a = document.createElement('a');
  var url = URL.createObjectURL(blob);
  a.href = url;
  a.download = 'your-file-name.webm';
  a.click();
  // URL.revokeObjectURL(url);
};

if you want to save it in some directory under ~/Downloads

I guess you should do something for that such like https://developer.chrome.com/extensions/downloads#method-download

if you want to save it "any" directory of the machine

It might not be permitted to browser's JavaScript runtime. If you want to do that, you should create native application and request permission to do that. If you're JavaScrip lover, electron is the easiest way to build native (desktop) application. http://electron.atom.io/

otiai10 avatar Feb 16 '17 09:02 otiai10