Adobe Flash 从麦克风录制压缩样本

发布于 2024-12-21 13:39:07 字数 570 浏览 8 评论 0原文

我想从 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 技术交流群。

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

发布评论

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

评论(1

完美的未来在梦里 2024-12-28 13:39:08

您可以使用以下命令将录音编码为 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.

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