Is there a way to specify or at least get the recording audio format in the browser?

102 Views Asked by At

I'm trying to record audio on the browser and I am currently using Firefox. The goal is to be able to encode the audio data to Opus using a module compiled in Emscripten. I am using the code here as a guide https://github.com/F1LT3R/voip-js.

I notice that he is using the Speex library to resample the audio and that he is treating the audio frames as floats. How can I set the audio format on the browser itself? Can I set audio to be recorded in, for example, 48000Hz 16-bit signed PCM data, which can be easily encoded?

If not, is there at least a way I can get the format?

0

There are 0 best solutions below