使用kAudioFormatiLBC初始化audiounit [英] initialize audiounit with kAudioFormatiLBC
问题描述
我正在尝试使用ilbc初始化AudioUnit来录制音频。不幸的是,我需要使用ilbc作为编解码器,我不能选择另一个。
阅读文档和论坛后我发现使用ilbc的正确流描述符应该是这样的:
i'm trying to initialize an AudioUnit to record audio using ilbc. Unfortunatly i need to use ilbc as codec and i cannot choose a different one.
after reading the documentation and forums I found that the correct stream descriptor for using ilbc should be something like:
streamDesc.mSampleRate = 8000.0;
streamDesc.mFormatID = kAudioFormatiLBC;
streamDesc.mChannelsPerFrame = 1;
然后我使用:
AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0, NULL, &size, &streamDesc);
填充结构中的空字段,但我总是收到格式错误。
to fill the empty field in the structure, but i always get an error about the format.
有人对streamDesc的正确参数有所了解吗?
anyone has some idea on the right parameters for the streamDesc?
谢谢
推荐答案
您无法通过音频单位或图表处理压缩流格式,例如kAudioFormatiLBC,但不支持此格式。
You can't process a compressed stream format such as kAudioFormatiLBC though Audio Units or Graphs, this is not supported.
这篇关于使用kAudioFormatiLBC初始化audiounit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!