Improve audio-on-demand MP3 duration accuracy in Wowza Streaming Engine

This article describes how to improve MP3 duration accuracy for audio-on-demand with Wowza Streaming Engine™ media server software.

Notes:
  • In most cases, the built-in duration calculation is sufficient and it's not necessary to add the properties described in this article. Only add the properties if you need precise duration.
  • Enabling the properties will have a small effect on performance. If you have large MP3 files, the accuracy of the duration will be more apparent.

To calculate more accurate frame sizes, in Application.xml, add the following properties to the <MediaReader>/<Properties> container element:

<MediaReader>
    <!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this application -->
    <Properties>
        <Property>
            <Name>calculateMoreAccurateFrameSize</Name>
            <Value>true</Value>
            <Type>Boolean</Type>
        </Property>
        <Property>
            <Name>calculateMoreAccurateFrameWindow</Name>
            <Value>200</Value>
            <Type>Integer</Type>
        </Property>
    </Properties>
</MediaReader>

The calculateMoreAccurateFrameWindow property instructs Wowza Streaming Engine to sample the first 200 frames for more accurate chunk size information.