UK IPTV · 1 MONTH £7.49 GBP TOTALInstall your player. Request a one-day trial ↗

Viewing journal

A stereo offline audio buffer does not need its frame length doubled

OfflineAudioContext length is measured in sample frames. Each frame contains a sample for every channel, so duration uses the frame count and sample rate.

Frame rate is another variable
Frame rate is another variable

Media diagnostics · Primary-source explanation; examples are illustrative. Instructions are based on publisher guidance; a UK IPTV account was not tested on this platform.

Count frames before channels

An offline browser audio render creates an AudioBuffer instead of sending its output directly to speakers. Its constructor takes a channel count, a length in sample frames and a sample rate. MDN defines a sample frame as containing a sample for every channel. Therefore a stereo render does not need twice as many sample frames as a mono render merely to occupy the same time. Channel count and duration are different dimensions.

Work out a short render

For an original calculation, a three second render at 48,000 sample frames per second needs 144,000 sample frames. A stereo buffer of that length holds 288,000 individual channel samples, but its duration remains three seconds. Setting a length of 288,000 frames would instead allocate six seconds at that rate. Keeping the two counts distinct prevents a common doubled duration error in small browser audio export tools.

Verify what the application produced

Compare the resulting buffer duration with the intended programme segment, then check the exported file separately if the application performs an additional encoding step. An offline buffer existing in memory is not itself a saved audio file or proof of successful download. Record the channel count and rate with the length so a later reviewer can reproduce the duration calculation. This example explains allocation arithmetic and does not claim a measured UK IPTV audio format, a tested browser render or a universal supported output rate.

Sources and further reading

Continue reading

Make the first step a useful one

Your screen.
Your next good evening.

Tell us the device and player you use. Compare the term, ask your questions and prepare for a one-day trial.

↑