raycarino--- via dev-media wrote:
I'm on firefox 59. My microphone records audio at a sample rate of 44.1khz.
However, MediaRecorder outputs OGG Opus audio at 48khz.
This is what you wanted, right?
Thank you for the quick reply!
Sorry, for the typo. Expected: 48kHz output. Actual is 44.1kHz. It seems that
the resampling logic either failed or wasn't reached.
No worries. I figured there was a typo somewhere, just trying to figure
out exactly where.
The Ogg Opus file format does not actually support encoding 44.1 kHz
audio directly, so unless you can hear some sort of weird pitch shifting
going on, that means it hit the resampling logic correctly.
What it does do is store the original sampling rate in the header as
metadata. That lets other tools resample back to the original sampling
rate if that is appropriate. E.g., if the input was originally 44.1 kHz,
it's normal to resample back to 44.1 kHz when decoding to a file to
avoid surprises for users who don't know that Opus internally only
supports sample rates that evenly divide 48 kHz. But if you were just
playing the file back, you'd normally skip that resampling as most
soundcards run at 48 kHz natively.
I hope that helps!
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media