标签:
AudioQueue几个重要参数
AudioQueueRef inputQueue;//队列 AudioQueueBufferRef inputBuffers[3];//缓冲区 可以定义宏容易修改,一般为3个,设置多个可以让语音播放不卡 AudioStreamBasicDescription audioDescription;//音频采集参数设置
///设置音频参数 audioDescription.mSampleRate = 8000; //采样率 audioDescription.mFormatID = kAudioFormatLinearPCM; audioDescription.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; audioDescription.mChannelsPerFrame = 1; ///单声道 audioDescription.mFramesPerPacket = 1; //每一个packet一侦数据 audioDescription.mBitsPerChannel = 16; //每个采样点16bit量化 audioDescription.mBytesPerFrame = (audioDescription.mBitsPerChannel / 8) * audioDescription.mChannelsPerFrame; audioDescription.mBytesPerPacket = audioDescription.mBytesPerFrame; AudioQueueNewOutput(&audioDescription, AudioPlayerAQInputCallback, (__bridge void*)self, nil, nil, 0, &audioQueue); //使用player的内部线程播放
AudioQueueAllocateBuffer(audioQueue, MIN_SIZE_FRAME, &audioQueueBuffers[i]);//初始化音频缓冲区
AudioQueueStop(audioQueue, true);//停止队列 AudioQueueReset(audioQueue);//重置队列 AudioQueueDispose(_inputQueue, true);//销毁队列
AudioQueue语音流 speex压缩 实时通讯 对讲机
标签:
原文地址:http://www.cnblogs.com/yeng/p/5582123.html