问题描述
我已经试过真的很难找到一个示例,演示了如何在Flash播放Speex语音连接codeD音频。我尝试以下code -
I have tried really hard to find an example showing how to play speex encoded audio in flash. I tried the following code -
var connect_nc:NetConnection = new NetConnection();
connect_nc.connect(null);
var stream_ns:NetStream = new NetStream(connect_nc);
stream_ns.play("RE-Sample.m4a");
avaible在 -
avaible at -
http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player _03.html
http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player _03.html
我测试了上述code与FLV的视频和AAC EN codeD音频文件,它工作得很好。但是,当我尝试stream_ns.play(sample.spx),我收到了流未发现异常。
I tested the above code with .flv videos and AAC encoded audio files and it works just fine. But when I try stream_ns.play("sample.spx") I get a stream not found exception.
我是使用了错误的容器(.SPX)的Speex音频。正在播放从文件Speex音频支持?请大家帮忙!
Am I using the wrong container (.spx) for speex audio. Is playing speex audio from a file supported? please help!
(这将是巨大的,如果你能提供一个例子。)
(It would be great if you can provide an example.)
推荐答案
ArtBIT好像是从我的测试中正确的为好。 SPX只是播放的音频codeC的FLV容器中。您有几种选择:
ArtBIT seems to be correct from my tests as well. SPX is only playable as the audio codec in a FLV container. You have a few options:
- 包装你的SPX通过重新编码这些文件的时间提前了FLV容器。
- 请一个活使用FMS或反code红/ Xuggle(http://www.pubbs.net/200906/osflash/18579-red5-streaming-speex-audio.html)
- 装载SPX作为一个字节数组,然后使用这样的库与FLV包装它:的
希望这有助于。
这篇关于ADOBE FLASH:从文件播放Speex音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!