raycarino--- via dev-media wrote:
I have a follow on question. What's the best way to determine an Ogg Opus 
file's encoded sample rate?

Opus is a lossy codec. The sample rate is something that is lost as part of the lossy encoding. The original sample rate in the header gives you a hint as to the best sample rate to run the decoder at to get all of the information that was encoded, but it is perfectly possible to run it any supported rate (8 kHz, 12 kHz, 16 kHz, 24 kHz, and 48 kHz), regardless of how it was encoded.

You _could_ get some idea of the content of the audio by looking at the TOC byte in each of the packets (c.f. RFC 6716 Section 3.1). NB implies 8 kHz, MB implies 12 kHz, WB implies 16 kHz, SWB implies 24 kHz, and FB implies 48 kHz. But this is allowed to change on a packet-by-packet basis, and the encoder may in fact change it based on the content of the audio that was fed to it and the requested bitrate (regardless of what sampling rate the encoder was running at). I'm not aware of a tool that actually inspects and reports on this information, either.
_______________________________________________
dev-media mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-media

Reply via email to