I am trying to redirect sound to speakers in the iOS AppRTC example .
I tried:
AVAudioSession* session = [AVAudioSession sharedInstance]; //error handling BOOL success; NSError* error; //set the audioSession category. //Needs to be Record or PlayAndRecord to use audioRouteOverride: success = [session setCategory:AVAudioSessionCategoryPlayAndRecord error:&error]; if (!success) NSLog(@"AVAudioSession error setting category:%@",error); //set the audioSession override success = [session overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&error]; if (!success) NSLog(@"AVAudioSession error overrideOutputAudioPort:%@",error); //activate the audio session success = [session setActive:YES error:&error]; if (!success) NSLog(@"AVAudioSession error activating: %@",error); else NSLog(@"audioSession active");
There are no errors, but this does not work. How can i fix this?
ios avfoundation audio webrtc apprtcdemo
Alon gubkin
source share