3
votes

I am attempting to record live audio via USB microphone to be converted to WAV and uploaded to a server. I am using Chrome Canary (latest build) on Windows XP. I have based my development on the example at http://webaudiodemos.appspot.com/AudioRecorder/index.html

I see that when I activate the recording, the onaudioprocess event input buffers (e.inputBuffer.getChannelData(0) for example) are all zero-value data. Naturally, there is no sound output or recorded when this is the case. I have verified the rest of the code by replacing the input buffer data with data that produces a tone which shows up in the output WAV file. When I use approaches other than createMediaStreamSource, things are working correctly. For example, I can use createObjectURL and set an src to that and successfully hear my live audio played back in real time. I can also load an audio file and using createBufferSource, see that during playback (which I hear), the inputBuffer has non-zero data in it, of course.

Since most of the web-audio recording demos I have seen on the web rely upon createMediaStreamSource, I am guessing this has been inadvertantly broken in some subsequent release of Chrome. Can anyone confirm this or suggest how to overcome this problem?

1
can you post the your code? - Kevin Ennis
You can reference the code for the test page at webaudiodemos.appspot.com/AudioRecorder/index.html . The only change I made to this code was to console.log the e.inputBuffer.getChannelData(0) to see that it was all zero-value. - Charles Horowitz
Hmm. I'm seeing good data in the input buffers. What OS and version of Chrome are you using? - Kevin Ennis

1 Answers

2
votes

It's probably not the version of Chrome. Live input still has some high requirements right now:

1) Input and output sample rates need to be the same on Windows 2) Windows 7+ only - I don't believe it will work on Windows XP, which is likely what is breaking you. 3) Input device must be stereo (or >2 channels) - many, if not most, USB microphones show up as a mono device, and Web Audio isn't working with them yet.

I'm presuming, of course, that my AudioRecorder demo isn't working for you either.

These limitations will be removed over time.