【发布时间】:2012-01-18 15:21:25
【问题描述】:
我正在尝试将声音对象的字节数组添加到捕获的麦克风声音字节数组中。
它可以工作,但是提取的声音对象会被缩小并加倍长度。我猜这是因为声音对象的字节数组是立体声,而麦克风字节数组是单声道。
我有这个:
sound.extract(myByteArray, extract);
myByteArray 现在包含立体声数据。我怎样才能把它变成单声道(我是 ByteArrays 的新手)。
更新:
这是一个可行的解决方案:
existingByte.position = 0;
var mono : ByteArray = new ByteArray();
while(existingByte.bytesAvailable) {
var left : Number = existingByte.readFloat();
mono.writeFloat(left);
existingByte.position +=4;
}
【问题讨论】:
标签: audio actionscript bytearray microphone