Flash actionscript 3.0: Play sound files by using Local File Browser

Play sound files by using Local File Browser

Posted by Sankar.G | Posted in | Posted on 4:20 PM


One of the readers requested for to play audio file by using local file browser,thought i will post it so that it may help others who might have siame requirement.

We cannot select and play a audio file by using fileReference because fileReference object doesn’t return the file path of the audio file [this will not be an issue if you are developing a AIR application, as you can use'File' object which will return file path]. So our only choice here is to load the audio file as binary data using fileReference objects ‘load’ method.

And we need to Convert the wave audio data into raw data and use Sound objects Sample data Api to play back.

An API which can convert Wave into raw audio for to play in sound Channel and a small example is below.

Sound_Play.zip

Comments (0)