Flash swf to play PCM WAV files?

假如想象 提交于 2019-12-06 12:21:21

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+.

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!