Reputation: 1397
I have been investigating AVAudioSessionRouteChangeReason notification. One of them is
AVAudioSessionRouteChangeReasonRouteConfigurationChange
According to Apple document: AVAudioSessionRouteChangeReasonRouteConfigurationChange
The set of input and output ports has not changed, but their configuration has—for example, a port’s selected data source has changed.
It is not very clear that under which scenario AVAudioSessionRouteChangeReasonRouteConfigurationChange can be called. If someone could make an example what a port's selected data source has changed meaning?
Thanks
Upvotes: 2
Views: 277
Reputation: 1042
I'm looking for the 'Doc' answer as well, but I can also provide some example. After phone call ended I received AVAudioSessionInterruptionTypeEnded notification and just after it this one:
{
AVAudioSessionRouteChangePreviousRouteKey = "<AVAudioSessionRouteDescription: 0x1c001e380, \ninputs = (null); \noutputs = (\n \"<AVAudioSessionPortDescription: 0x1c001e4d0, type = Speaker; name = G\\U0142o\\U015bnik; UID = Speaker; selectedDataSource = (null)>\"\n)>";
AVAudioSessionRouteChangeReasonKey = 8;
}
and new Route was:
<AVAudioSessionRouteDescription: 0x1c401de70,
inputs = (
"<AVAudioSessionPortDescription: 0x1c401dac0, type = MicrophoneBuiltIn; name = iPhone Mikrofon; UID = Built-In Microphone; selectedDataSource = Bottom>"
);
outputs = (
"<AVAudioSessionPortDescription: 0x1c401df10, type = Speaker; name = G\U0142o\U015bnik; UID = Speaker; selectedDataSource = (null)>"
)>
So it looks like selected data source for microphone changed from null to bottom.
Upvotes: 1