在 AS3 Flash/Flex 项目中嵌入 wav 文件?
Flash IDE 能够嵌入多种类型的未压缩声音文件(包括 wav),并在发布时提供可选的压缩。
然而,[Embed] 标签似乎只允许嵌入 mp3 文件。嵌入未压缩的 wav 文件真的不可能,还是我错过了一些神奇的、未记录的 mimeType?
我希望得到类似的东西:
[Embed source="../../audio/wibble.wav" mimeType="audio/wav"]
...但是我得到了
no transcoder registered for mimeType 'audio/wav'
可以将 wav 或其他格式嵌入为八位字节流并在运行时解析,但我认为这是相当严厉的。
令我惊讶的是,尽管 Flash IDE 可以嵌入未压缩的声音数据,但 [Embed] 却不能,因为 swf 规范可以包含未压缩的声音数据。
有接受者吗?
The Flash IDE is capable of embedding many types of uncompressed sound files, including wav, and offers optional compression when publishing.
However, the [Embed] tag, only seems to allow embedding of mp3 files. Is it truly impossible to embed an uncompressed wav file, or am I missing some magic, undocumented mimeType?
I was hoping for something like:
[Embed source="../../audio/wibble.wav" mimeType="audio/wav"]
...but I get
no transcoder registered for mimeType 'audio/wav'
It's possible to embed wav or other format as an octet-stream and parse at runtime, but that's pretty heavy handed I think.
I'm surprised that even though the Flash IDE can embed uncompressed sound data, [Embed] cannot, given that the swf spec can contain uncompressed sound data.
Any takers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自 LiveDocs - 使用声音的基础知识:
但显然有一个解决方法。检查来自actionscript.org的此帖子中的帖子#3:
From the LiveDocs - Basics of working with sound:
But apparently there's a workaround. Check post #3 in this thread from actionscript.org:
您可以使用一个库
http://code.google.com/p/as3wavsound/
There's a library you can use
http://code.google.com/p/as3wavsound/
Flash播放器不知道如何直接播放wav文件。确实,您可以将它们导入到创作工具中,但是当您发布 SWF 时,您的音频将被转换为 mp3 或 adpcm 或您在发布设置中选择的任何格式。即使您在运行时读取 wav,播放它的唯一方法是解析二进制流,因此如果您嵌入该文件,自然也会应用相同的限制。
此问题中的一些相关信息。奇怪的是你去年似乎对此发表过评论! :)
The Flash player doesn't know how to directly play wav files. It's true that you can import them to the authoring tool, but when you publish the SWF your audio will be converted to mp3 or adpcm or whatever you select in your publish settings. Even if you read in a wav at runtime, the only way to play it is by parsing the binary stream, so naturally the same limitation applies if you embed the file.
Some related info at this question. Which curiously you seem to have commented on last year! :)