Audio Operators
The following operators can be applied to an audio
stream:
volume
volume
Sets the linear gain of an audio
stream. A linear gain of 1.0 represents a logarithmic gain of 0 dB. Linear and logarithmic gains are related as follows:
dB = 20.0 * log10 (volume), volume = pow10 (dB / 20.0)
mix
mix
Combines multiple audio
streams. Each element of the array supports the following properties:
Property | Type | Description |
---|---|---|
name | string | Identifies the input stream. |
level | number | Normalized linear gain applied to all input stream channels. A value of 1.0 represents 0 dB gain. |
phase | number | Rotation applied to all input channels in degrees (0, 90, -90 or 180). |
channel | array | Lists the input channels mixed into each output channel. The output stream channels property determines the dimension of the array.The array items are either the input channel number (1 based) or a channel object as described below. |
The channel object identifies a specific input channel. The object supports the following properties:
Property | Type | Description |
---|---|---|
channel | integer | Identifies the input channel by number (1 based). |
label | enum | Identifies the input channel by speaker label. |
program | integer | Identifies the input channel by program number. |
level | number | Normalized linear gain applied to the input channel. A value of 1.0 represents 0 dB gain. |
phase | number | Rotation applied to the input channel in degrees (0, 90, -90 or 180). |
The phase
property applies a phase rotation (in 90 degree increments) and can be applied to a stream or a specific channel. For example the standard Dolby ProLogic down mix is implemented as follows:
---
input:
container:
- name: input1
audio:
- name: surround
channels: 6
label:
- L
- R
- C
- LFE
- Ls
- Rs
output:
container:
- name: output1
type: 'mp4 '
audio:
- name: stereo
channels: 2
mix:
- name: surround
channel:
- label: L
- label: R
- name: surround
level: 0.707107
channel:
- label: C
- label: C
- name: surround
level: 0.707107
channel:
- label: LFE
- label: LFE
- name: surround
phase: -90
channel:
- label: Ls
level: 0.87178
- label: Ls
level: 0.489898
- name: surround
phase: 90
channel:
- label: Rs
level: 0.489898
- label: Rs
level: 0.87178
{
"input": {
"container": [
{
"name": "input1",
"audio": [
{
"name": "surround",
"channels": 6,
"label": [
"L",
"R",
"C",
"LFE",
"Ls",
"Rs"
]
}
]
}
]
},
"output": {
"container": [
{
"name": "output1",
"type": "mp4 ",
"audio": [
{
"name": "stereo",
"channels": 2,
"mix": [
{
"name": "surround",
"channel": [
{
"label": "L"
},
{
"label": "R"
}
]
},
{
"name": "surround",
"level": 0.707107,
"channel": [
{
"label": "C"
},
{
"label": "C"
}
]
},
{
"name": "surround",
"level": 0.707107,
"channel": [
{
"label": "LFE"
},
{
"label": "LFE"
}
]
},
{
"name": "surround",
"phase": -90,
"channel": [
{
"label": "Ls",
"level": 0.87178
},
{
"label": "Ls",
"level": 0.489898
}
]
},
{
"name": "surround",
"phase": 90,
"channel": [
{
"label": "Rs",
"level": 0.489898
},
{
"label": "Rs",
"level": 0.87178
}
]
}
]
}
]
}
]
}
}
Updated about 1 year ago