Alright so I've spent many hours searching on how to use AVAudioPlayer and AVAudioRecorder at the same time(audio player through the speaker), and I am continually pointed to this section of code:
This is supposed to override the audioplayer source to the speaker, which makes perfect sense, but I cannot get xcode to recognize any form of kAudioSessionProperty_OverrideAudioRoute. I keep getting this error: "Use of undeclared identifier 'kAudioSessionOverrideAudioRoute_Speaker' "
I understand what the error is saying, but I what I don't understand is why it doesn't recognize the constant. Any thoughts?
Code:
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,sizeof (audioRouteOverride),&audioRouteOverride);
This is supposed to override the audioplayer source to the speaker, which makes perfect sense, but I cannot get xcode to recognize any form of kAudioSessionProperty_OverrideAudioRoute. I keep getting this error: "Use of undeclared identifier 'kAudioSessionOverrideAudioRoute_Speaker' "
I understand what the error is saying, but I what I don't understand is why it doesn't recognize the constant. Any thoughts?