我用下面的方法创建音频队列
AudioQueueNewOutput(&audioFormat, audioQueueOutputCallback, (__bridge void*)self, NULL, NULL, 0, &mAudioQueue)格式如下所示
audioFormat.mFormatID = kAudioFormatAC3;
audioFormat.mBytesPerPacket = 0;
audioFormat.mFramesPerPacket = mavfContext->streams[audio_index]->codec->frame_size;
audioFormat.mBytesPerFrame = 0;
audioFormat.mChannelsPerFrame = mavfContext->streams[audio_index]->codec->channels;
audioFormat.mBitsPerChannel = 0;由于kAudioFormatUnsupportedDataFormatError,创建失败。我已经检查过mavfContext->streams[audio_index]->codec->frame_size是0。那么,ac3介质的mFramesPerPacket有什么标准值吗?
发布于 2012-08-15 23:06:35
AC3帧的大小应该是256 *通道,因此在这里我会期望:
mFramesPerPacket = 256 * mChannelsPerFrame。
https://stackoverflow.com/questions/11704351
复制相似问题