Joe's Blog

line

A blog by Joe Billman about programming, and other stuff

line

Archive for January, 2013

SoundChannel position doesn’t = Sound length

Posted on: January 29th, 2013 by Joe

line No Comments

So I recently made an AIR app at work that we use for finding cue points in an mp3 file. It loads an mp3 file, creates the sound wave spectrum for said file and then allows the user to target different locations in the file and output them as cue points. While working on this project I noticed that I was getting weird results on the the location of the play head in the audio file. It was really noticeable at the end of the file. The position property of the SoundChannel object at the end of the file didn’t equal the length property of the Sound object. It was a variable amount of┬ámilliseconds┬ábehind it. After a beating my head for a while and doing some searching online I realized what the problem was. It was all due to the bit rate at which the mp3 was saved. Anything below 128 was causing it to be off and the amount that it was off varied depending on the bit rate. If it was saved above 128 it was fine, but below caused problems. So if you are playing mp3 files in the Flash Player the ideal settings are 44100 Hz with a bit rate of 128 Kbps or higher. Also just as a side note if you don’t sample it at 44100 Hz the audio actually sounds bad as well. Hope this helps. Flash Player is still the best way to play audio files on the web.


Warning: Use of undefined constant Y - assumed 'Y' (this will throw an Error in a future version of PHP) in /homepages/16/d145171736/htdocs/php/footer.php on line 1