Audio Session Services: kAudioSessionProperty_OverrideAudioRoute with various input and output routes

I was messing around with Audio Session Services. I am trying to control the AudioSessionSetProperty: audio track AudioSessionSetProperty: kAudioSessionProperty_OverrideAudioRoute as kAudioSessionOverrideAudioRoute_Speaker .

The problem is that it changes the route for both input and output. What I want is a set of input data from the headset microphone and speaker output.

Any ideas?

Ty!

+6
source share
1 answer

You can do this in iOS 5 with properties:

 kAudioSessionProperty_InputSource kAudioSessionProperty_OutputDestination 

For possible values ​​(which sources / destinations are available on the device), use AudioSessionGetProperty with properties:

 kAudioSessionProperty_InputSources kAudioSessionProperty_OutputDestinations 

For iOS 3.1+, I assume that you are using the PlayAndRecord audio session - you can try setting kAudioSessionProperty_OverrideCategoryDefaultToSpeaker to true. For instance,

 UInt32 defaultToSpeaker = 1; status = AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof (defaultToSpeaker), &defaultToSpeaker ); 

It may not be exactly what you are looking for, but I don’t think you can get closer in <iOS 5.

+3
source

Source: https://habr.com/ru/post/888450/


All Articles