如何将 wav 嵌入到 as3/flash builder 中?
我有:
[Embed(source="assets/sounds/claps.wav")]
public var testSound:Class;
private var blahsound:Sound = Sound(new testSound());
但运气不佳...
最佳答案
You can't 。嗯,不直接。
Although there are various sound file formats used to encode digital audio, ActionScript 3.0, Flash Player and AIR support sound files that are stored in the mp3 format. They cannot directly load or play sound files in other formats like WAV or AIFF.
您需要在嵌入之前将其转换为 mp3。或者将其嵌入为 ByteArray,然后尝试使用 SampleDataEvent.SAMPLE_DATA
使用 wav 文件中的字节手动填充声音缓冲区,但您将不得不做一些欺骗。
关于actionscript-3 - 嵌入 wav as3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7821874/