Adobe Flash 从麦克风录制压缩样本
我想从 adobe AIR 应用程序中的麦克风捕获音频样本,然后将它们保存到 flv 文件中。我有以下代码:
mic.setSilenceLevel(0, DELAY_LENGTH);
mic.codec = SoundCodec.SPEEX;
mic.encodeQuality = 6;
mic.framesPerPacket = 1;
mic.gain = 100;
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
问题是我怀疑在我的处理程序中我只获取原始样本而不是压缩样本。我怀疑的原因是,我获得的每条消息的字节数等于 20 毫秒(我的定义是 1 speex 帧)的原始音频而不是压缩音频。如果我更改encodeQuality,字节数也不会改变。阅读文档表明 adobe 只会在传输到闪存媒体服务器或其他对等点之前压缩音频。有没有办法在本地发布和读取流以获得压缩样本。 ?或者还有其他方法来获取压缩样本吗?
I want to capture audio samples from the microphone in my adobe AIR application and then save them to an flv file. I have the following code:
mic.setSilenceLevel(0, DELAY_LENGTH);
mic.codec = SoundCodec.SPEEX;
mic.encodeQuality = 6;
mic.framesPerPacket = 1;
mic.gain = 100;
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, micSampleDataHandler);
The problem is that I suspect that in my handler I am only getting raw samples and not compressed samples. The reason for my suspicion is that the number of bytes I get per message is equal to 20 ms (which my definition is 1 speex frame) of raw audio and not compressed audio. Also the number of bytes doesnt change if I change the encodeQuality. Reading the documentation suggests that adobe will only compress the audio before transmission to a flash media server or another peer. Is there a way to publish and read the stream locally in order to get compressed samples.
? Or any other way to get the compressed samples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用以下命令将录音编码为 mp3
http://code.google.com/p/flash-kikko/
然后保存文件某处,以便您可以将其合并到 flv 中。
You can encode your recording as mp3 using
http://code.google.com/p/flash-kikko/
Then save the file somewhere so you can incorporate that into an flv.