streamproc / MediaStreamRecorder

Cross browser audio/video/screen recording. It supports Chrome, Firefox, Opera and Microsoft Edge. It even works on Android browsers. It follows latest MediaRecorder API standards and provides similar APIs.
https://www.webrtc-experiment.com/msr/
MIT License
2.63k stars 563 forks source link

How to Save Recorded Audio into Folder #115

Open HatimSaif opened 7 years ago

HatimSaif commented 7 years ago

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

otiai10 commented 7 years ago

'''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/