Fix for: Surround sound audio on Apple TV #371

Added audio configuration option to the settings menu to allow users to select their speaker setup.
This commit is contained in:
Nitropud
2021-07-11 09:10:55 -07:00
committed by Cameron Gutman
parent 87be7080cb
commit 701c83d79c
7 changed files with 34 additions and 6 deletions

View File

@@ -631,15 +631,13 @@ static NSMutableSet* hostList;
// multiController must be set before calling getConnectedGamepadMask
_streamConfig.multiController = streamSettings.multiController;
_streamConfig.gamepadMask = [ControllerSupport getConnectedGamepadMask:_streamConfig];
// Probe for supported channel configurations
long outputChannels = [AVAudioSession sharedInstance].maximumOutputNumberOfChannels;
Log(LOG_I, @"Audio device supports %d channels", outputChannels);
if (outputChannels >= 8) {
int numberOfChannels = [streamSettings.audioConfig intValue];
Log(LOG_I, @"Number of audio channels %d", numberOfChannels);
if (numberOfChannels >= 8) {
_streamConfig.audioConfiguration = AUDIO_CONFIGURATION_71_SURROUND;
}
else if (outputChannels >= 6) {
else if (numberOfChannels >= 6) {
_streamConfig.audioConfiguration = AUDIO_CONFIGURATION_51_SURROUND;
}
else {