Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 嵌入wav as3_Actionscript 3 - Fatal编程技术网

Actionscript 3 嵌入wav as3

Actionscript 3 嵌入wav as3,actionscript-3,Actionscript 3,如何将wav嵌入as3/flash builder 我有: [Embed(source="assets/sounds/claps.wav")] public var testSound:Class; private var blahsound:Sound = Sound(new testSound()); 但是没有运气…。嗯,不是直接的 虽然有各种声音文件格式用于数字编码 音频、ActionScript 3.0、Flash播放器和AIR support声音文件 以mp3格式存储。它们不能直接加

如何将wav嵌入as3/flash builder

我有:

[Embed(source="assets/sounds/claps.wav")]
public var testSound:Class;
private var blahsound:Sound = Sound(new testSound());
但是没有运气…

。嗯,不是直接的

虽然有各种声音文件格式用于数字编码 音频、ActionScript 3.0、Flash播放器和AIR support声音文件 以mp3格式存储。它们不能直接加载或播放声音 其他格式的文件,如WAV或AIFF


在嵌入之前,您需要将其转换为mp3。或者将其作为字节数组嵌入,然后尝试使用wav文件中的字节手动填充声音缓冲区,但您将不得不进行一些欺骗。

这是可能的,但有黑客行为。正如@32bitkid所说,FP不直接支持加载mp3以外的声音文件。解决方案是将wav作为
ByteArray
,在内存中构造一个SWF(与使用Flash IDE一样,您可以添加wav文件),然后从该SWF访问声音对象


查看

您可以尝试使用开源库(AWS)。它支持嵌入.wav文件并以本机方式播放。

好的,那么可以使用mp3吗?与air一起使用的最佳格式是什么?我需要一个快速的响应,android上的东西会有延迟…实际上你可以,在某种程度上使用[As3WavSound]()。该库从未完成,但仍具有一些基本功能。在水下它使用你提到的技术。