2 Replies Latest reply on Jul 26, 2010 12:41 PM by weizhangstrobe

    audio duration

    cayennecode Level 1

      Can someone remind me which class is responsible for calculating & reporting an mp3's duration during load?  thanks


      In an earlier OSMF version I had to dig into the guts to find where OSMF was polling the audio file's duration during load, and had to rewire it to always calculate the duration using bytesLoaded & bytesTotal.  This worked.  I've since lost those files, and don't remember where this occurs in the framework.


      My problem is that the duration is just wrong during load, and if I remember it correctly, the loading resource is tucked deeply into one of the Traits.


      Checkout the mp3's duration during load, and how they change after load is complete here for an example of the problem with OSMF's duration during load:  http://fracturedvisionmedia.com/FVM005

        • 1. Re: audio duration
          cayennecode Level 1

          Ok, I'm not sure why you'd want to remove the PROGRESS listener if the estimatedDuration is above 0.  But commenting out the removeEventListener here at least resolves the false duration reports during load of mp3's.


          private function onDownloadProgress(event:Event):void


          // Take the first good update, and wait until the download finishes.

          if (!isNaN(soundAdapter.estimatedDuration) &&

          soundAdapter.estimatedDuration > 0)


          //soundAdapter.removeEventListener(ProgressEvent.PROGRESS, onDownloadProgress);




          • 2. Re: audio duration
            weizhangstrobe Level 2

            bytesLoaded and bytesTotal are now in the LoadTrait class.


            -Wei Zhang

            Senior Computer Scientist

            Adobe Systems