From 59754a32c7f12898c0e04a6ed8684bf3284c8235 Mon Sep 17 00:00:00 2001 From: levs42 Date: Fri, 14 Jun 2024 12:29:15 -0700 Subject: [PATCH] Remove shouldMix from multitrack mixer --- Sources/IO/IOAudioMixerByMultiTrack.swift | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Sources/IO/IOAudioMixerByMultiTrack.swift b/Sources/IO/IOAudioMixerByMultiTrack.swift index f5f70559e..0f1221d8c 100644 --- a/Sources/IO/IOAudioMixerByMultiTrack.swift +++ b/Sources/IO/IOAudioMixerByMultiTrack.swift @@ -40,7 +40,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible { } private var tracks: [UInt8: IOAudioMixerTrack] = [:] { didSet { - shouldMix = 1 < tracks.count tryToSetupAudioNodes() } } @@ -52,7 +51,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible { } } } - private var shouldMix = false private var mixerNode: MixerNode? private var sampleTime: AVAudioFramePosition = IOAudioMixerByMultiTrack.defaultSampleTime private var outputNode: OutputNode? @@ -82,9 +80,6 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible { } private func tryToSetupAudioNodes() { - guard shouldMix else { - return - } do { try setupAudioNodes() } catch { @@ -183,10 +178,6 @@ extension IOAudioMixerByMultiTrack: IOAudioMixerTrackDelegate { // MARK: IOAudioMixerTrackDelegate func track(_ track: IOAudioMixerTrack, didOutput audioPCMBuffer: AVAudioPCMBuffer, when: AVAudioTime) { delegate?.audioMixer(self, track: track.id, didInput: audioPCMBuffer, when: when) - guard shouldMix else { - delegate?.audioMixer(self, didOutput: audioPCMBuffer, when: when) - return - } buffers[track.id]?.append(audioPCMBuffer, when: when) if settings.mainTrack == track.id { if sampleTime == Self.defaultSampleTime {