#mixing #input-output #mixer

bin+lib audio-mixer

Mixing audio by the input and output channel layout

5 releases

0.2.0 Apr 24, 2024
0.1.3 Sep 19, 2023
0.1.2 Jan 21, 2020
0.1.1 Dec 29, 2019
0.1.0 Dec 27, 2019

#156 in Audio

Download history 404/week @ 2024-06-12 222/week @ 2024-06-19 266/week @ 2024-06-26 400/week @ 2024-07-03 649/week @ 2024-07-10 491/week @ 2024-07-17 605/week @ 2024-07-24 473/week @ 2024-07-31 498/week @ 2024-08-07 222/week @ 2024-08-14 376/week @ 2024-08-21 340/week @ 2024-08-28 291/week @ 2024-09-04 621/week @ 2024-09-11 366/week @ 2024-09-18 253/week @ 2024-09-25

1,568 downloads per month

MPL-2.0 license

49KB
867 lines

Audio Mixer

CircleCI Build & Test

Mixing audio data from any input channel layout to any output channel layout, in a matrix-multiplication form.

output channel #1 ▸ │ Silence    │   │ 0, 0, 0, 0 │   │ FrontRight   │ ◂ input channel #1
output channel #2 ▸ │ FrontRight │ = │ R, C, 0, F │ x │ FrontCenter  │ ◂ input channel #2
output channel #3 ▸ │ FrontLeft  │   │ 0, C, L, F │   │ FrontLeft    │ ◂ input channel #3
                          ▴                 ▴         │ LowFrequency │ ◂ input channel #4
                          ┊                 ┊                ▴
                          ┊                 ┊                ┊
                      out_audio      mixing matrix m       in_audio

For example, the above means there are 3 output channels and 4 input channels. The order of output channels is Silence, FrontRight, and FrontLeft. The order of input channels is FrontRight, FrontCenter, FrontLeft, LowFrequency.

So the output data in the channel #2 will be:


Output data of ch #2 (FrontRight) =
    R x input channel #1 (FrontRight)   +
    C x input channel #2 (FrontCenter)  +
    0 x input channel #3 (FrontLeft)    +
    F x input channel #4 (LowFrequency)

where the C, F, L, R are mixing coefficients. The Silence channel is a unused channel in the output device, so its channel data will always be zero.

License

MPL-2

Dependencies

~105KB