Ogg Opus granule positions count samples on a fixed 48,000-samples-per-second clock, per channel. The identification header’s Input Sample Rate field describes the original input, not a replacement playback clock. A duration tool that uses that informational rate to interpret granules can report the wrong time for an otherwise coherent stream.
Convert a position difference
Imagine two ordinary audio-page granule positions differing by 48,000. The elapsed media interval is one second on this clock. It is also one second for stereo; the granule counter does not advance twice as fast because two channels exist. This calculation concerns a difference between appropriate positions, separate from initial pre-skip and final trimming rules.
Read original-input metadata separately
An illustrative stream may identify an original input of 44,100 Hz while using the fixed Ogg Opus granule convention. Dividing the granule difference by 44,100 would answer the wrong timing question. RFC 7845 says the original rate is not preserved by lossy compression as a playback instruction. It can still be useful metadata for workflows that deliberately resample exported PCM.
Keep the decoder and output path in context
The format permits supported decoding rates other than 48 kHz, and a device can have its own output requirements. Those processing choices do not redefine the stored granule clock. A report should label a header’s original-input value, the decoder’s configured output and the container time unit separately. Several different numbers can legitimately describe different stages of one audio presentation.
Check the timer before retiming audio
If an inspection panel’s duration differs from actual playback, a maintainer can compare its granule conversion and boundary handling first. A viewer can record the displayed duration and audible ending without changing playback speed. Preserve the original input-rate field rather than rewriting it merely to make a faulty calculator agree. The useful outcome is a correctly interpreted clock, with original recording metadata and downstream resampling left as separate facts rather than treated as evidence of a changed programme speed.
