alexbw / novocaine

Painless high-performance audio on iOS and Mac OS X
http://alexbw.github.com/novocaine/
MIT License
2.23k stars 273 forks source link

How to set kAudioSessionMode_Measurement #37

Closed rc1 closed 12 years ago

rc1 commented 12 years ago

Hello,

Is it/would it be possible to set kAudioSessionMode_Measurement? I have tried add the following but it did not work.

// try to set the session mode
UInt32 sessionMode = kAudioSessionMode_Measurement;
CheckError( AudioSessionSetProperty (kAudioSessionMode_Measurement,
                                     sizeof (kAudioSessionMode_Measurement),
                                     &sessionMode), "Could not set mode");

Thanks, Ross

rc1 commented 12 years ago

Ah, spotted my mistake. It should be the following. Is this something worth including in novocaine?

UInt32 sessionMode = kAudioSessionMode_Measurement;
CheckError( AudioSessionSetProperty (kAudioSessionProperty_Mode,
                                     sizeof (sessionMode),
                                     &sessionMode), "Could not set mode");

// Set the audio session active
CheckError( AudioSessionSetActive(YES), "Couldn't activate the audio session");