mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-22 01:57:18 +01:00
Stop CoreAudio from doing expensive audio rate conversion
This commit is contained in:
parent
a9762551cd
commit
71a4e8ed13
@ -734,6 +734,13 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||||||
if (!update_audio_session(this, SDL_TRUE)) {
|
if (!update_audio_session(this, SDL_TRUE)) {
|
||||||
return -1;
|
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
|
#endif
|
||||||
|
|
||||||
/* Setup a AudioStreamBasicDescription with the requested format */
|
/* Setup a AudioStreamBasicDescription with the requested format */
|
||||||
|
Loading…
Reference in New Issue
Block a user