I used the AudioToolbox framework, so I initialized my audio session as follows:
AudioSessionInitialize(NULL, NULL, NULL, NULL);
Here is the rest of my code that I used to set up the audio session. I did not redefine the audio track, and I also think that this is not necessary.
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
OSStatus err = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,
sizeof(sessionCategory),
&sessionCategory);
AudioSessionSetActive(TRUE);
if (err) {
NSLog(@"AudioSessionSetProperty kAudioSessionProperty_AudioCategory failed: %d", err);
}
stigi source
share