Don't call setPreferredOutputNumberOfChannels on iOS, it breaks audio output
parent
2c9871a4a8
commit
e3b0713e40
|
@ -855,6 +855,7 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||
AVAudioSession* session = [AVAudioSession sharedInstance];
|
||||
[session setPreferredSampleRate:this->spec.freq error:nil];
|
||||
this->spec.freq = (int)session.sampleRate;
|
||||
#if TARGET_OS_TV
|
||||
if (iscapture) {
|
||||
[session setPreferredInputNumberOfChannels:this->spec.channels error:nil];
|
||||
this->spec.channels = session.preferredInputNumberOfChannels;
|
||||
|
@ -862,6 +863,9 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||
[session setPreferredOutputNumberOfChannels:this->spec.channels error:nil];
|
||||
this->spec.channels = session.preferredOutputNumberOfChannels;
|
||||
}
|
||||
#else
|
||||
/* Calling setPreferredOutputNumberOfChannels seems to break audio output on iOS */
|
||||
#endif /* TARGET_OS_TV */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue