0
ActionScript3과 함께 Adobe AIR를 사용하여 iOS 장치의 마이크에서 녹음 된 사운드를 재생하고 있습니다. FileStream.writeFloat 메서드를 사용하여 파일에 마이크 샘플 (모노)을 저장합니다. 나중에 Sound 객체를 만들고 SampleEvent에 등록합니다. SampleEvent에서 이전에 마이크 샘플과 함께 저장된 파일을 읽고 두 번 씁니다 (출력이 스테레오이기 때문에).iOS의 ActionScript3로 사운드를 재생하면 바람직하지 않은 결과가 발생합니다.
문제는 내가 AIR 시뮬레이터에서 실행했을 때 위대한 사운드를 재생하고 iOS 기기 (iPad)에서 재생할 때 소리가 두 배 빠릅니다.
private function onSampleData(event : SampleDataEvent):void
{
// the following lines of code are modifying the sound object and creates a "pitch" effect
var sample:Number;
var outputLength:int = 0;
while (outputLength < 2048) {
// until we have filled up enough output buffer
if (_micSamplesStream.bytesAvailable < 4)
{
break;
}
// read out the left and right channels at this position
sample = _micSamplesStream.readFloat();
// write the samples to our output buffer
event.data.writeFloat(sample);
event.data.writeFloat(sample);
outputLength++;
}
}