0
OS X에서 코어 오디오를 사용하여 AIFF 파일의 프레임 집합을 FFT를 수행하기에 적합한 32 비트 부동 소수점 배열로 추출하는 방법이 있습니까?코어 오디오를 사용하여 AIFF에서 플로트 추출
OS X에서 코어 오디오를 사용하여 AIFF 파일의 프레임 집합을 FFT를 수행하기에 적합한 32 비트 부동 소수점 배열로 추출하는 방법이 있습니까?코어 오디오를 사용하여 AIFF에서 플로트 추출
예. 가장 쉬운 방법은 ExtAudioFile API를 사용하는 것입니다. 애플의 ConvertFile 샘플 코드에는 훌륭한 예제가있다. UseExtAF.cpp를보십시오.
44.1 kHz의 샘플 레이트를 들어, 32 비트 부동 소수점 LPCM에 대한 AudioStreamBasicDescription는 다음과 같이 보일 것이다 :
AudioStreamBasicDescription fmt;
fmt.mSampleRate = 44100;
fmt.mFormatID = kAudioFormatLinearPCM;
fmt.mFormatFlags = kLinearPCMFormatFlagIsFloat;
fmt.mBitsPerChannel = sizeof(Float32) * 8;
fmt.mChannelsPerFrame = 1; // set this to 2 for stereo
fmt.mBytesPerFrame = fmt.mChannelsPerFrame * sizeof(Float32);
fmt.mFramesPerPacket = 1;
fmt.mBytesPerPacket = fmt.mFramesPerPacket * fmt.mBytesPerFrame;