本文介绍了在flex中,是否可以嵌入speex文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

但是,我得到错误:

没有注册mimeType'audio / x-speex'的转码器

任何想法?

解决方案

我一直在研究这一些。这里有一些选项:
$ b $ ol
嵌入一个ogg speex文件并使用Alchemy编译的libOgg和libSpeex来对它进行解码。解码后的字节可以通过 SampleDataEvent.SAMPLE_DATA 。当我们知道libSpeex存在于Flash Player的某个地方的时候,Alchemy已经被使用了,这太痛苦了。

  • 你不能嵌入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 。格儿。也许还有其他转换工具可以做到这一点?



  • 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?

    解决方案

    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?

    这篇关于在flex中,是否可以嵌入speex文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    09-15 03:34