gpt4 book ai didi

apache-flex - 如何过滤闪光灯(10.1)中来自麦克风的声音?

转载 作者:行者123 更新时间:2023-12-03 01:05:53 24 4
gpt4 key购买 nike

我从麦克风传来一些声音。我需要为其添加声音过滤器,然后将其播放给与该麦克风说话的人。
怎么做这样的事情?

最佳答案

据我所知,这可以通过空气完成:
http://www.adobe.com/devnet/air/flex/articles/using_mic_api.html

这是满足您要求的示例代码:

import flash.media.Sound;
import flash.utils.ByteArray;
protected var soundRecording:ByteArray;
protected var soundOutput:Sound;
protected function playbackData():void
{
soundRecording.position = 0;

soundOutput = new Sound();
soundOutput.addEventListener(SampleDataEvent.SAMPLE_DATA, playSound);

soundOutput.play();
}

private function playSound(soundOutput:SampleDataEvent):void
{
if (!soundRecording.bytesAvailable > 0)
return;
for (var i:int = 0; i < 8192; i++)
{
var sample:Number = 0;

// apply your filter here
if (soundRecording.bytesAvailable > 0)
sample = soundRecording.readFloat();
soundOutput.data.writeFloat(sample);
soundOutput.data.writeFloat(sample);
}
}

关于apache-flex - 如何过滤闪光灯(10.1)中来自麦克风的声音?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2354558/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com