AS3 音频编码器转换为音频 [英] AS3 audiioencoder to convert to audio

查看:27
本文介绍了AS3 音频编码器转换为音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在动作脚本中如何使用音频编码器将记录的字节数组从麦克风转换为 MP3

In action script how to convert using audio encoder a recorded byte array from microphone to MP3

     public var recordedData:ByteArray;          
     recordedData.writeBytes(sample.data, 0, sample.data.bytesAvailable);

如何使用音频编码器将记录的数据保存到 mp3

How to save recordedData to mp3 using audio encoder

推荐答案

您发现自己是一个在 Flash 播放器中运行的 MP3 编码库.一个简单的谷歌搜索发现 Shine 非常受欢迎.另一种选择是将音频流式传输到服务器并在那里编码.

You find yourself an MP3 encoding library that runs in the Flash player. A simple google search finds Shine to be pretty popular. Another option is to stream the audio up to the server and encode there.

根据您的环境,如果您在 Air 中并且是愿意构建一个原生扩展来进行编码.

Depending on your environment, you might be able to use something like LAME if you are in Air and are willing to build a native extension to do the encoding.

编辑

如果您使用的是 Shine,我发现了一个 项目中的示例 暗示编码很容易:

If you are using Shine, I found an example in the project that implies that encoding is easy:

private var mp3Encoder:ShineMP3Encoder;

private function encodeClicked(event:Event):void {
    mp3Encoder = new ShineMP3Encoder(wavLoader.data);
    mp3Encoder.addEventListener(Event.COMPLETE, mp3EncodeComplete);
    mp3Encoder.addEventListener(ProgressEvent.PROGRESS, mp3EncodeProgress);
    mp3Encoder.addEventListener(ErrorEvent.ERROR, mp3EncodeError);
    mp3Encoder.start();
}

private function saveClicked(event : MouseEvent) : void {
    mp3Encoder.saveAs();
}

这篇关于AS3 音频编码器转换为音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆