Skip to content
Permalink
Browse files

Stop CoreAudio from doing expensive audio rate conversion

  • Loading branch information
slouken committed Feb 23, 2017
1 parent a976255 commit 71a4e8ed1348293efc867c40b321ab040500fced
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/audio/coreaudio/SDL_coreaudio.m
@@ -734,6 +734,13 @@ static BOOL update_audio_session(_THIS, SDL_bool open)
if (!update_audio_session(this, SDL_TRUE)) {
return -1;
}

/* Stop CoreAudio from doing expensive audio rate conversion */
@autoreleasepool {
AVAudioSession* session = [AVAudioSession sharedInstance];
[session setPreferredSampleRate:this->spec.freq error:nil];
this->spec.freq = (int)session.sampleRate;
}
#endif

/* Setup a AudioStreamBasicDescription with the requested format */

0 comments on commit 71a4e8e

Please sign in to comment.