iphone - AudioQueue output channels -
i have problem audio stream (this lpcm stream 6 channels inside). when playing stream on iphone via audioqueue hear first 2 channels. here audioqueue initialization code:
- (id)initwithsamplerate:(int)asamplerate numchannels:(int)anumchannels { self = [super init]; audiostreambasicdescription thedescription; thedescription.mformatid = kaudioformatlinearpcm; thedescription.msamplerate = asamplerate; thedescription.mchannelsperframe = anumchannels; thedescription.mbytesperpacket = 2 * anumchannels; thedescription.mframesperpacket = 1; thedescription.mbytesperframe = 2 * anumchannels; thedescription.mbitsperchannel = 16; thedescription.mformatflags = kaudioformatflagsnativeendian | kaudioformatflagissignedinteger; audioqueuenewoutput(&thedescription, audioqueue_callback, self, cfrunloopgetcurrent(), kcfrunloopcommonmodes, 0, &audioqueue); audioqueuestart(audioqueue, null); return self; }
do know how solve problem? should set output channels count 2, how?
you might need to, in own code, pre-mix 6 channels down 2 channels before feeding pcm audio stream audio queue api.
Comments
Post a Comment