Changing sample rate, Web Audio API, getUserMedia -- forward from [chromium-discuss]

---------- Forwarded message ----------
From: Shiming He <heshiming@gmail.com<mailto:heshiming@gmail.com>>
Date: Thu, Jan 10, 2013 at 11:14 AM
Subject: [chromium-discuss] Changing sample rate, Web Audio API, getUserMedia
To: chromium-discuss@chromium.org<mailto:chromium-discuss@chromium.org>


Dear Community,

I'm working on a project that uses Web Audio API and getUserMedia to capture microphone input and POST it to the server via HTTP. In this particular project I might not be able to use a media server to accept WebRTC connections directly. The 'Recorderjs' project (https://github.com/mattdiamond/Recorderjs) did a great job in recording and producing a wave file. However the recorded file format is locked to 44khz - stereo - 16bit (the default audio context format) which is boatload of data. My app only needed 16khz - mono - 16bit format.

Later on I discovered it's not possible to change the sample rate of `webkitAudioContext`. It looks like `OfflineAudioContext` accepts format argument when created (though this function is yet to be exposed to Javascript). But in the discussion here: https://github.com/mattdiamond/Recorderjs/issues/11 , Chris Wilson pointed out that eventually it might not be possible to connect microphone input to OfflineAudioContext because it's not designed for realtime recording.

So it looks like I'm stuck with writing an interpolation algorithm to downsample before sending.

Is it true? Is it not possible to record in 16khz?

Best regards,
He Shiming
--
Chromium Discussion mailing list: chromium-discuss@chromium.org<mailto:chromium-discuss@chromium.org>
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

Received on Thursday, 10 January 2013 05:44:58 UTC