tags:

views:

357

answers:

2

I am in need of a Flash swf that is capable of loading PCM WAV files via a url passed to it.

An example of the file can be found here: http://msdn.microsoft.com/en-us/library/ff512405.aspx

The swf does not need a visible interface, as it is meant for audio playing only and not user interaction.

The swf should have a simple javascript interface for page-level interactions. These include:

load(url): loads a PCM WAV file over the internet using the url that is passed through it. play(): Should play the PCM WAV file that was loaded stop(): Should stop playing the current file.

I can provide a sample audio file that matches the specifications if the developer is unable to obtain a url from the link posted above.

A: 

http://www.schillmania.com/projects/soundmanager2/

You can also use the HTML5 audio tag (however this does not use flash). See http://www.whatwg.org/ for some examples of that.

Maz
I don't see any support for PCM wav here.
spender
Yeah, which is sadly why I need a flash option. Safari supports it just fine, Firefox kind of, and Chrome has no support.
Geuis
A: 

Flash does not natively support run-time playback of PCM encoded audio. This means that you'll need to parse the WAV container to get at the audio and feed it in (flash 10+).

http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-3.html

Somewhat more significantly, you'll require crossdomain permission to be able to do so, because you need programmatic access the wave data.

Another option is to use some code I wrote a while back to bake the wave data into an in-memory swf, load it and extract a valid Sound object back out.

http://flashbrighton.org/?p=9

The article is quite old now, and the the silent-sound technique should be avoided, but you may be able to repurpose the code to do your bidding. Using this method will work with Flash 9+.

spender
spender, I can't find your contact info. Please email me at [email protected]
Geuis
@geuis, I'm too busy to enter into private dialog FTTB. What's the problem? Looks like the code might be missing from that post :). I'll see if it didn't get munched in an HD crash I had a while back.
spender
It appears a newer versions of my code lives on here: http://www.libspark.org/svn/as3/Craptune/tags/v0.3b/lib/PCMAudioLibrary/nu/mine/flashnet/sound/core/ File SoundFactory.as is where the magic happens.
spender