2
votes

I'm trying to get the raw audio in getUserMedia() success callback and post it to the server. The success callback receives the LocalMediaStream object.

var onSuccess = function(s) {
var m=s.getAudioTracks(s);
//m[0] contains MediaStreamTrack object for audio
//get the raw audio and do the stuff  
}

But there is no attribute or method to get the raw audio from channels in MediaStreamTrack. How can we access the raw audio into this callback which is called on success of getUserMedia()?

I found the Recorder.js library-- https://github.com/mattdiamond/Recorderjs But it is recording blank audio in Chrome: Version 26.0.1410.64 m. It works fine on Chrome: Version 29.0.1507.2 canary SyzyASan.

I think there is issue of Web Audio API used by recorder.js

I'm looking for the solution without Web Audio API, that should work at least on chrome's official build.

1
FYI, it's probably an issue with your flags. go to chrome://flags and look for one about microphone access or getusermedia. Can't remember what it's called. But if you enable that, it should work in Chrome 26. I doubt it's a RecorderJS bug - there are a lot of people using that library.Kevin Ennis

1 Answers

3
votes

Check out the MediaStreamAudioSourceNode. You can create one of those (via the AudioContext's createMediaStreamSource method) and then connect the output to RecorderJS or a plain old ScriptProcessorNode (which is what RecorderJS is built on).

Edit: Just realized you're asking if you can access the raw audio samples without the Web Audio API. As far as I know, I don't think that's possible.