Skip to content

Commit

Permalink
Enable tracks based on their bus number
Browse files Browse the repository at this point in the history
  • Loading branch information
levs42 committed Jun 7, 2024
1 parent ad35dac commit a21fd09
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sources/IO/IOAudioMixerByMultiTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible {
let mixerNode = try MixerNode(format: outputFormat)
try mixerNode.update(busCount: tracks.count, scope: .input)
let busCount = try mixerNode.busCount(scope: .input)
if busCount > tracks.count {
for index in tracks.count..<busCount {
try mixerNode.enable(bus: UInt8(index), scope: .input, isEnabled: false)
}
for index in 0..<busCount {
try mixerNode.enable(bus: UInt8(index), scope: .input, isEnabled: false)
}
for (bus, track) in tracks {
try mixerNode.enable(bus: bus, scope: .input, isEnabled: true)
try mixerNode.update(format: outputFormat, bus: bus, scope: .input)
var callbackStruct = AURenderCallbackStruct(inputProc: inputRenderCallback,
inputProcRefCon: Unmanaged.passUnretained(self).toOpaque())
Expand Down

0 comments on commit a21fd09

Please sign in to comment.