好的,诺豆到iOS。我正在使用音频队列缓冲区来录制音频。线性PCM格式默认为44100 Hz,1通道,16位,小端。有没有办法可以强制8000赫兹,1通道,32位浮点,小端的格式?
答案 0 :(得分:0)
您可以在初始化时指定所需的格式:
AudioStreamBasicDescription asbd;
asbd.mSampleRate = 8000;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFormatFlags = kLinearPCMFormatFlagIsFloat;
asbd.mBytesPerPacket = sizeof(float);
asbd.mFramesPerPacket = 1;
asbd.mBytesPerFrame = sizeof(float);
asbd.mChannelsPerFrame = 1;
asbd.mBitsPerChannel = sizeof(float) * CHAR_BIT;
asbd.mReserved = 0;
OSStatus e = AudioQueueNewInput(&asbd, ...............