音のエネルギーを使用してマイクから 1 分あたりの拍数 (BPM) を決定しようとしています。BPM を決定する部分はわかったと思いますが、RAW データを取得するのに少し問題があります。
この例は、Apples SpeakHere アプリに基づいています - 私が使用している AudioQueue コールバック関数:
SInt16 *buffer = (SInt16*)inBuffer->mAudioData;
for (int i = 0; i < (inBuffer->mAudioDataByteSize)/sizeof(SInt16); i++)
{
printf("before modification %d\n", (int)*buffer);
buffer++;
}
しかし、私はいくつかの興味深い値を取得しています - 誰かが私が間違っている場所の正しい方向に私を向けて、私が返すべき範囲を教えてくれる可能性があります.
オーディオ形式のセットアップ:
mRecordFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
mRecordFormat.mBitsPerChannel = 16;
mRecordFormat.mBytesPerPacket = mRecordFormat.mBytesPerFrame = (mRecordFormat.mBitsPerChannel / 8) * mRecordFormat.mChannelsPerFrame;
mRecordFormat.mFramesPerPacket = 1;
乾杯、