在flex中,是否可以嵌入speex文件?

发布于 2024-07-27 19:31:23 字数 298 浏览 13 评论 0原文

Flash 10 据说支持 Speex 音频格式。 我想在我的 SWF 中嵌入一些 Speex 文件:

[Embed(source='assets/test.spx',mimeType='audio/x-speex')]
private static const SpeexSound:Class;

但是,我收到错误:

no transcoder registered for mimeType 'audio/x-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;

However, I get the error:

no transcoder registered for mimeType 'audio/x-speex'

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夢归不見 2024-08-03 19:31:23

Speex 不是真正的传输格式 - 它没有内置到协议中的框架,因此它通常封装在 OGG 流中(不幸的是,其 API 比 Speex API 本身更复杂,但我离题了......)所以“音频/x-speex”的真正意思是“OGG 中的 Speex”。

我还没有在任何地方看到 Flash 支持 OGG - 所以从 speexenc 获得的那些文件将无法工作:(

据报道,Flash 以 FLV 格式对 Speex 进行编码/解码(根据此页面:< a href="http://jira.red5.org/confluence/display/codecs/Speex+Codec" rel="nofollow noreferrer">http://jira.red5.org/confluence/display/codecs/Speex+Codec )我还没有尝试过这个,因为我想以 Flash 9 为目标(也许 ffmpeg 可以通过一些调整来正确编码),但如果你对此有任何进展,请告诉我。

Speex is not a real transport format -- it has no framing built into the protocol, so it is typically wrapped in an OGG stream (whose API is unfortunately more complicated than the Speex API itself, but I digress...) So "audio/x-speex" really means "Speex in OGG".

I haven't seen anywhere that Flash supports OGG -- so those files you get from speexenc aren't going to work :(

Reportedly Flash encodes/decodes Speex in FLV format (according to this page: http://jira.red5.org/confluence/display/codecs/Speex+Codec). I haven't tried this because I want to target Flash 9 (maybe ffmpeg would encode correctly with some fiddling) but let me know if you get anywhere with this.

吻泪 2024-08-03 19:31:23

我对此进行了更多研究。 以下是选项:

  1. 嵌入 ogg speex 文件并使用 Alchemy 编译的 libOgg 和 libSpeex 对其进行解码。 解码后的字节可以通过 SampleDataEvent.SAMPLE_DATA。 当我们知道 libSpeex 存在于 Flash Player 中的某个地方时,必须使用 Alchemy,这真是令人痛苦的讽刺。
  2. 您无法嵌入 FLV,但可以嵌入 SWF,因此请将 Speex FLV 转换为 Speex SWF。 可以使用 ffmpeg 完成转换,如下所示:

    $ ffmpeg -i test-with-speex.flv -vn test.swf 
      

    但是,不幸的是,这会在 SWF 中自动将音频转换为 MP3。 您应该能够像这样保留编解码器

    $ ffmpeg -i test-with-speex.flv -vn -acodec libspeex test.swf 
      

    但 ffmpeg 目前不支持非 MP3 SWF。 咕噜。 也许还有其他转换工具可以做到这一点?

I've been researching this some more. Here are the options:

  1. 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.
  2. 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
    

    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
    

    but ffmpeg doesn't currently support non-MP3 SWFs. Grr. Perhaps there's other conversion tools that will do it?

独孤求败 2024-08-03 19:31:23

在服务器端,您可以使用这个欺骗性的 ffmpeg 项目:

http://code。 google.com/p/xuggle-ffmpeg/

并对音频进行编码,如下所示:

ffmpeg -i test.wav -acodec libspeex -f flv -y speex.flv

On the server-side, you can use this tricked-out ffmpeg project:

http://code.google.com/p/xuggle-ffmpeg/

And encode your audio something like this:

ffmpeg -i test.wav -acodec libspeex -f flv -y speex.flv
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文