diff --git a/pkg/config/pipeline.go b/pkg/config/pipeline.go index 01832520..058e6cd7 100644 --- a/pkg/config/pipeline.go +++ b/pkg/config/pipeline.go @@ -82,7 +82,7 @@ type SDKSourceParams struct { TrackKind string AudioInCodec types.MimeType VideoInCodec types.MimeType - AudioTrack *TrackSource + AudioTracks []*TrackSource VideoTrack *TrackSource } diff --git a/pkg/pipeline/builder/audio.go b/pkg/pipeline/builder/audio.go index 5517b49e..207a0fc4 100644 --- a/pkg/pipeline/builder/audio.go +++ b/pkg/pipeline/builder/audio.go @@ -137,8 +137,8 @@ func (b *AudioBin) buildWebInput() error { } func (b *AudioBin) buildSDKInput() error { - if b.conf.AudioTrack != nil { - if err := b.addAudioAppSrcBin(b.conf.AudioTrack); err != nil { + for _, tr := range b.conf.AudioTracks { + if err := b.addAudioAppSrcBin(tr); err != nil { return err } } diff --git a/pkg/pipeline/source/sdk.go b/pkg/pipeline/source/sdk.go index fcffefe5..666fda50 100644 --- a/pkg/pipeline/source/sdk.go +++ b/pkg/pipeline/source/sdk.go @@ -471,7 +471,7 @@ func (s *SDKSource) onTrackSubscribed(track *webrtc.TrackRemote, pub *lksdk.Remo s.mu.Unlock() if !s.initialized.IsBroken() { - s.AudioTrack = ts + s.AudioTracks = append(s.AudioTracks, ts) } case types.MimeTypeH264, types.MimeTypeVP8, types.MimeTypeVP9: