actionscript-3 - 嵌入 wav as3

标签 actionscript-3

如何将 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/

相关文章:

c++ - AS3 中的计数器 "without dynamic text field"

actionscript-3 - 为什么在文件未完成加载时调度 URLStream 完成事件?

apache-flex - 弯曲时的狗耳效应?

actionscript-3 - "SecurityError: Error #2122"从重定向图像加载内容

actionscript-3 - 将YouTube channel 嵌入Flash网站

python - 查找美国各县的 GPS 坐标

actionscript-3 - AS3 : two functions with the same name but incompatible signatures from two interfaces

actionscript-3 - 从类访问时间轴对象,给出空对象引用?

javascript - FireFox 与 IE 中基于 AS 的 Flash 应用程序的大小调整

actionscript-3 - SharedObject 支持哪些数据类型?