开发者

Flash: Generate/display sound waveform for uploaded sound

I have a project that requires me to display the waveform for a uploaded sound. The sound is always an MP3, most of the time 22.05 kHz mono, with开发者_如何转开发 speech only. The project are written with Flex/ActionScript 3. It's meant to run in the browser, but might also consider converting to AIR if that can help.

All examples I've found and looked at for generating a wave, are either doing some visualization in real time as the sound is playing, or, the most promising, as3soundeditorlib, keeps the wave already generated, but does it very slowly, seemingly using as long time as playing through the audio would've taken.

Is there any way to generate the wave faster than real time?


Once you have a sound object, you can get the raw data into a byte array using the extract method. Then you use the values as your y values and time as your x value, and you have a graph for your wave form.


I don't do Flex (yet), but here's a C# sample for doing this:

Open source C# code to present wave form?

If you know how to draw simple lines on a surface in Flex, you should be able to translate the C# method:

http://livedocs.adobe.com/flex/3/html/help.html?content=Drawing_Vector_Graphics_1.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜