问题描述
Flash 10 据说支持 Speex 音频格式.我想在我的 SWF 文件中嵌入一些 Speex 文件:
Flash 10 supposedly has support for the Speex audio format. I'd like to embed some Speex files in my SWF:
[Embed(source='assets/test.spx',mimeType='audio/x-speex')]
private static const SpeexSound:Class;
但是,我收到错误:
no transcoder registered for mimeType 'audio/x-speex'
有什么想法吗?
推荐答案
我一直在对此进行更多研究.以下是选项:
I've been researching this some more. Here are the options:
- 嵌入 ogg speex 文件并使用 Alchemy 编译的 libOgg 和 libSpeex 对其进行解码.解码后的字节可以通过 SampleDataEvent.SAMPLE_DATA输入 Flash一>.当我们知道 libSpeex 存在于 Flash Player 的某个地方时,不得不使用 Alchemy 真是讽刺.
您不能嵌入 FLV,但可以嵌入 SWF,因此将 Speex FLV 转换为 Speex SWF.可以像这样使用 ffmpeg 完成转换:
- Embed an ogg speex file and use an Alchemy-compiled libOgg and libSpeex to decode it. The decoded bytes can be fed into Flash via SampleDataEvent.SAMPLE_DATA. Its painfully ironic that Alchemy has to be used, when we know that libSpeex lives in the Flash Player somewhere.
You can't embed FLVs, but you can embed SWFs, so convert a Speex FLV into a Speex SWF. The conversion can be done with ffmpeg like this:
$ ffmpeg -i test-with-speex.flv -vn test.swf
但是,不幸的是,这会在 SWF 中将音频自动转换为 MP3.您应该能够像这样保留编解码器
However, that will unfortunately auto-convert the audio into MP3 inside the SWF. You should be able to preserve the codec like this
$ ffmpeg -i test-with-speex.flv -vn -acodec libspeex test.swf
但 ffmpeg 目前不支持非 MP3 SWF.咕噜噜也许还有其他转换工具可以做到这一点?
but ffmpeg doesn't currently support non-MP3 SWFs. Grr. Perhaps there's other conversion tools that will do it?
这篇关于在 flex 中,是否可以嵌入 speex 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!