Skip to content

Commit 27a3a83

Browse files
authored
Merge pull request #899 from nathanwhy/fix/preferred-output-number-of-channels
Fix: preferred output number of channels
2 parents db2d75b + eb28e1f commit 27a3a83

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Sources/KSPlayer/MEPlayer/AudioRendererPlayer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public class AudioRendererPlayer: AudioOutput {
4949
if #available(macOS 11.3, iOS 14.5, tvOS 14.5, *) {
5050
synchronizer.delaysRateChangeUntilHasSufficientMediaData = false
5151
}
52-
// if #available(tvOS 15.0, iOS 15.0, macOS 12.0, *) {
53-
// renderer.allowedAudioSpatializationFormats = .monoStereoAndMultichannel
54-
// }
52+
if #available(tvOS 15.0, iOS 15.0, macOS 12.0, *) {
53+
renderer.allowedAudioSpatializationFormats = .monoStereoAndMultichannel
54+
}
5555
}
5656

5757
public func prepare(audioFormat: AVAudioFormat) {
@@ -133,7 +133,7 @@ public class AudioRendererPlayer: AudioOutput {
133133
renderer.audioTimePitchAlgorithm = channelCount > 2 ? .spectral : .timeDomain
134134
renderer.enqueue(sampleBuffer)
135135
#if !os(macOS)
136-
if AVAudioSession.sharedInstance().preferredInputNumberOfChannels != channelCount {
136+
if AVAudioSession.sharedInstance().preferredOutputNumberOfChannels != channelCount {
137137
try? AVAudioSession.sharedInstance().setPreferredOutputNumberOfChannels(Int(channelCount))
138138
}
139139
#endif

0 commit comments

Comments
 (0)