Changed audio route to Speaker

edited April 2013

Hi there
We are integrating your framework in our apps. We have a an audioController to Record input from the micro, initialized like this

                // description            
                AudioStreamBasicDescription audioDescriptionForRecording;
                memset(&audioDescriptionForRecording, 0, sizeof(audioDescriptionForRecording));
                audioDescriptionForRecording.mFormatID          = kAudioFormatLinearPCM;
                audioDescriptionForRecording.mFormatFlags       = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsNonInterleaved;
                audioDescriptionForRecording.mChannelsPerFrame  = 1;
                audioDescriptionForRecording.mBytesPerPacket    = sizeof(SInt16);
                audioDescriptionForRecording.mFramesPerPacket   = 1;
                audioDescriptionForRecording.mBytesPerFrame     = sizeof(SInt16);
                audioDescriptionForRecording.mBitsPerChannel    = 8 * sizeof(SInt16);
                audioDescriptionForRecording.mSampleRate        = 22050.0; // modifying pitch
            
                AEAudioController *audioControllerForRecording = [[[AEAudioController alloc] initWithAudioDescription:audioDescriptionForRecording inputEnabled:YES] autorelease];
                audioControllerForRecording.preferredBufferDuration = 0.005;
                [_sharedInstance setAudioControllerForRecording:audioControllerForRecording];

we add a recorder as an input receiver, in simulator it works like a charm, the problem comes in device, the engine it is started like this

TAAE: Setting audio session category to PlayAndRecord
TAAE: Audio session initialized (input available, audio route 'SpeakerAndMicrophone')
TAAE: Changed audio route to SpeakerAndMicrophone

But after some seconds, the route is changed to TAAE: Changed audio route to Speaker, so we are not able to get the levels, [_audioControllerForRecording inputAveragePowerLevel:&inputAvg peakHoldLevel:&inputPeak];

Regards

Comments

  • Hi @AlePety,

    What device are you using? What hardware are you using with it? Are you plugging/unplugging anything? Do you see any errors?

Sign In or Register to comment.