Debian Codegraph @

third_party/rust/audio-mixer/README.md

raw
1 # Audio Mixer
2
3 [![CircleCI](https://circleci.com/gh/mozilla/audio-mixer.svg?style=svg)](https://circleci.com/gh/mozilla/audio-mixer)
4 [![Build & Test](https://github.com/mozilla/audio-mixer/actions/workflows/test.yml/badge.svg)](https://github.com/mozilla/audio-mixer/actions/workflows/test.yml)
5
6 Mixing audio data from any input channel layout to any output channel layout,
7 in a *matrix-multiplication* form.
8
9 ```
10 output channel #1 ▸ │ Silence │ │ 0, 0, 0, 0 │ │ FrontRight │ ◂ input channel #1
11 output channel #2 ▸ │ FrontRight │ = │ R, C, 0, F │ x │ FrontCenter │ ◂ input channel #2
12 output channel #3 ▸ │ FrontLeft │ │ 0, C, L, F │ │ FrontLeft │ ◂ input channel #3
13 ▴ ▴ │ LowFrequency │ ◂ input channel #4
14 ┊ ┊ ▴
15 ┊ ┊ ┊
16 out_audio mixing matrix m in_audio
17 ```
18
19 For example, the above means there are 3 output channels and 4 input channels.
20 The order of output channels is _Silence, FrontRight, and FrontLeft_.
21 The order of input channels is _FrontRight, FrontCenter, FrontLeft, LowFrequency_.
22
23 So the output data in the _channel #2_ will be:
24 ```
25
26 Output data of ch #2 (FrontRight) =
27 R x input channel #1 (FrontRight) +
28 C x input channel #2 (FrontCenter) +
29 0 x input channel #3 (FrontLeft) +
30 F x input channel #4 (LowFrequency)
31 ```
32
33 where the _C, F, L, R_ are mixing coefficients.
34 The _Silence_ channel is a unused channel in the output device,
35 so its channel data will always be zero.
36
37 ## License
38
39 MPL-2