Tuesday, April 5, 2011

Sound Object position bytes

Hi All! I use Sound object http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/media/Sound.html from my player. It method play get first param startTime in milliseconds. How i can get position in bytes by the time.

From stackoverflow
  • var song:SoundChannel=new SoundChannel();
                var mp3:Sound=new Sound(new URLRequest("http://localhost/file.mp3"));
                var positionInBytes:int=0;
    
    
                song=mp3.play();
                positionInBytes=song.position/mp3.length*mp3.bytesTotal;
    

0 comments:

Post a Comment