ios - Using AudioQueueNewInput to record stereo -
i use audioqueuenewinput create stereo recording. configured follows:
audioformat.mformatid = kaudioformatlinearpcm; hardwarechannels = 2; audioformat.mchannelsperframe = hardwarechannels; audioformat.mformatflags = kaudioformatflagissignedinteger | kaudioformatflagispacked | kaudioformatflagisbigendian; audioformat.mframesperpacket = 1; audioformat.mbitsperchannel = 16; audioformat.mbytesperpacket = (audioformat.mbitsperchannel / 8) * hardwarechannels; audioformat.mbytesperframe = audioformat.mbytesperpacket; osstatus result = audioqueuenewinput( &audioformat, recordingcallback, (__bridge void *)(self), // userdata null, // run loop null, // run loop mode 0, // flags &queueobject ); audioqueuestart ( queueobject, null // start time. null means possible. );
i tested code on iphone 6s plus external stereo microphone. not seem record stereo. both left , right channels identical streams of data. else need record stereo?
Comments
Post a Comment