feat: add setting for audio configuration

This commit is contained in:
Acaki
2025-07-07 20:13:39 +08:00
parent af2a2728f8
commit 489e60d2b1
7 changed files with 219 additions and 14 deletions
@@ -821,6 +821,10 @@ static NSMutableSet* hostList;
// Probe for supported channel configurations
int physicalOutputChannels = (int)[AVAudioSession sharedInstance].maximumOutputNumberOfChannels;
Log(LOG_I, @"Audio device supports %d channels", physicalOutputChannels);
if (@available(iOS 18.0, tvOS 18.0, *)) {
physicalOutputChannels = 8;
Log(LOG_I, @"System-provided spatial audio available, pretending device has %d channels", physicalOutputChannels);
}
int numberOfChannels = MIN([streamSettings.audioConfig intValue], physicalOutputChannels);
Log(LOG_I, @"Selected number of audio channels %d", numberOfChannels);