Verify Both Sources in a Web Audio Player
Admin ·
Check both files from a web audio export before adding them to a player. A file extension and an HTML media type need to agree with the actual container, and each version needs to play the whole recording.
Prepare and listen to the six-second web export
Choose Load practice audio or download the example WAV and open it. The source is six seconds of stereo PCM at 16 kHz. Keep Medium (96 kbps) selected and choose Prepare web audio.
Download the MP3 and Ogg Opus files. The Opus export uses 48 kHz stereo for this source. Play each file individually near 0.5, 3 and 5.5 seconds to hear three groups of tones that rise in pitch. Compare the measured sizes before deciding which file to list first.
Open Audio for Web CompressorDownload the six-second stereo WAVIETF Ogg encapsulation for Opus audio
Match each HTML source to its real container
Review the HTML audio markup beside the downloads. It lists the Ogg Opus file first and the MP3 fallback second. The .opus extension in this download belongs to an Ogg container, so its media type is audio/ogg with the opus codec. The browser evaluates the source candidates in order.
Upload both verified files to your own site and update the generated paths if the files live separately from the page. Serve each file with the corresponding HTTP Content-Type.
<audio controls preload="metadata">
<source src="audio-for-web.opus" type="audio/ogg; codecs=opus">
<source src="audio-for-web.mp3" type="audio/mpeg">
</audio>WHATWG HTML media source elementIETF Ogg encapsulation for Opus audio
Test the fallback and compare the final transfer size
Load the player in the browsers you support. Use developer tools to see which file it requests. Temporarily keep only the MP3 source in a test copy of the page and confirm that it still plays the complete clip.
Test a real voice or music asset after the tone sample. Change one preset at a time and compare the saved bytes and listening result for both formats. Keep the shorter transfer only if the file works for the intended player and the sound meets your needs.
WHATWG HTML media source elementOpen Audio for Web Compressor
Common questions
Can I rename an Opus file to make it work as a different container?
A new extension does not change the file structure. Use the exported container and its matching media type, or encode the same source into the required container.
Which bitrate should I use for a strict transfer budget?
Compare the actual saved bytes against the budget. The preset guides the encoder, and the final size also depends on duration and container overhead.