Skip to content

Commit adf3f81

Browse files
EBU ADM Renderer Authorstomjnixon
authored andcommitted
version 1.0.0
0 parents  commit adf3f81

File tree

149 files changed

+24886
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+24886
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.py]
12+
indent_style = space
13+
indent_size = 4
14+
insert_final_newline = false
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

.gitignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
.pytest_cache
45+
46+
nosetests.xml
47+
coverage.xml
48+
*,cover
49+
.hypothesis/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Django stuff:
56+
*.log
57+
local_settings.py
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# dotenv
85+
.env
86+
87+
# virtualenv
88+
.venv
89+
venv/
90+
ENV/
91+
92+
# Spyder project settings
93+
.spyderproject
94+
95+
# Rope project settings
96+
.ropeproject

.gitlab-ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image: python:3
2+
3+
test:
4+
before_script:
5+
- apt-get update -qy
6+
- apt-get install -y libsndfile1
7+
- pip install tox
8+
script:
9+
- tox
10+
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright 2018 EBU ADM Renderer Authors
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md
2+
include ear/core/data/README.md
3+
include tox.ini

README.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# EBU ADM Renderer (EAR)
2+
3+
The **EBU ADM Renderer** **(*EAR*)** is a complete interpretation of the **Audio Definition Model (ADM)** format, specified in Recommendation [ITU-R BS.2076-1](https://www.itu.int/rec/R-REC-BS.2076/en). ADM is the recommended format for all stages and use cases within the scope of programme productions of **Next Generation Audio (NGA)**. This repository contains a Python reference implementation of the EBU ADM Renderer.
4+
5+
This Renderer implementation is capable of rendering audio signals to all reproduction systems mentioned in ["Advanced sound system for programme production (ITU-R BS.2051-1)"](https://www.itu.int/rec/R-REC-BS.2051/en).
6+
7+
Further descriptions of the *EAR* algorithms and functionalities can be found in EBU Tech 3388.
8+
9+
## Test files
10+
A initial set of ADM files to test the *EAR* can be found under
11+
- https://ebu.io/qc/testmaterial and
12+
- http://cvssp.org/data/s3a/public/radiodrama_register.php
13+
14+
## Installation
15+
16+
To install the latest release from PyPi:
17+
18+
```bash
19+
$ pip install ear
20+
```
21+
22+
### Python versions
23+
24+
*EAR* supports Python 2.7 and Python >=3.6
25+
and runs on all major platforms (Linux, Mac OSX, Windows).
26+
27+
### Installation of extra packages
28+
29+
If you want to run the unit tests you can install all extra requirements with pip:
30+
```bash
31+
$ pip install ear[test]
32+
```
33+
34+
## Getting started
35+
36+
The *EAR* reference implementation comes with two command line tools:
37+
38+
- `ear-render` Is the main tool to render BW64/ADM audio files
39+
- `ear-utils` Collection of useful ADM utilities
40+
41+
### Command line renderer
42+
43+
```bash
44+
usage: ear-render [-h] [-d] -s target_system [-l layout_file]
45+
[--output-gain-db gain_db] [--fail-on-overload]
46+
[--enable-block-duration-fix] [--strict]
47+
input_file output_file
48+
49+
EBU ADM renderer
50+
51+
positional arguments:
52+
input_file
53+
output_file
54+
55+
optional arguments:
56+
-h, --help show this help message and exit
57+
-d, --debug print debug information when an error occurres
58+
-s target_system, --system target_system
59+
Target output system, accoring to ITU-R BS.2051.
60+
Available systems are: 0+2+0, 0+5+0, 2+5+0, 4+5+0,
61+
4+5+1, 3+7+0, 4+9+0, 9+10+3, 0+7+0, 4+7+0
62+
-l layout_file, --layout layout_file
63+
Layout config file
64+
--output-gain-db gain_db
65+
output gain in dB (default: 0)
66+
--fail-on-overload, -c
67+
fail if an overload condition is detected in the
68+
output
69+
--enable-block-duration-fix
70+
automatically try to fix faulty block format durations
71+
--strict treat unknown ADM attributes as errors
72+
```
73+
74+
To render an ADM file, the following three parameters must be given:
75+
- `-s` followed by the target output format to render to
76+
- the name of the input file
77+
- the name of the output file
78+
79+
For example `ear-render -s 0+5+0 input.wav output_surround.wav` will render the BW64/ADM file `input.wav` to a `0+5+0` target speaker layout and store the result in `output_surround.wav`.
80+
81+
The *optional* `--layout` parameter allows to specify the real loudspeaker positions and screen dimensions of a reproduction setup.
82+
Refer to [the layout file documentation](doc/layout_file.md) for more information about its format.
83+
84+
`--fail-on-overload` makes the rendering process fail in case an overload in the output channels to ensure any signal clipping doesn't go unnoticed. Use `--output-gain-db` to adjust the output gain.
85+
86+
`--enable-block-duration-fix` automatically fixes durations of `audioBlockFormats` in case they are not continuous.
87+
**Please note** that the proper way to handle this situation is to fix the input file.
88+
89+
`--strict` enables strict ADM parsing mode. Some of the currently available
90+
ADM/BW64 files may not strictly adhere to the BS.2076 specification, for example by including xml attributes that are not part of the standard.
91+
The default behaviour is to output a warning and continue processing.
92+
When strict mode is enabled, warnings are turned into errors and processing is stopped.
93+
94+
95+
**Please note** that, depending on the size of the file, it may
96+
take some time to render the file. At the time of writing, the parsing of the ADM XML data is relatively slow when the ADM is large (>= a few megabytes).
97+
98+
### Command line ADM utilities
99+
100+
The `ear-utils` command provides various subcommands which can be seen on the help message
101+
when called with `ear-utils --help`:
102+
103+
Each subcommand may have its own command line options, which can be
104+
displayed using `ear-utils SUBCOMMAND --help`, where `SUBCOMMAND` is one of the supported subcommands.
105+
106+
```bash
107+
usage: ear-utils [-h]
108+
{make_test_bwf,replace_axml,dump_axml,dump_chna,ambix_to_bwf}
109+
...
110+
111+
EBU ADM renderer utilities
112+
113+
optional arguments:
114+
-h, --help show this help message and exit
115+
116+
available subcommands:
117+
{make_test_bwf,replace_axml,dump_axml,dump_chna,ambix_to_bwf}
118+
make_test_bwf make a bwf file from a wav file and some metadata
119+
replace_axml replace the axml chunk in an existing ADM BWF file
120+
dump_axml dump the axml chunk of an ADM BWF file to stdout
121+
dump_chna dump the chna chunk of an ADM BWF file to stdout
122+
ambix_to_bwf make a BWF file from an ambix format HOA file
123+
```
124+
125+
#### HOA ADM Creation
126+
```bash
127+
usage: ear-utils ambix_to_bwf [-h] [--norm NORM] [--nfcDist NFCDIST]
128+
[--screenRef] [--chna-only]
129+
input output
130+
131+
positional arguments:
132+
input input file
133+
output output BWF file
134+
135+
optional arguments:
136+
-h, --help show this help message and exit
137+
--norm NORM normalization mode
138+
--nfcDist NFCDIST Near-Field Compensation Distance (float)
139+
--screenRef Screen Reference
140+
--chna-only use only CHNA with common definitions
141+
```
142+
143+
144+
To convert an ambiX file in an ADM one, the following two parameters must be given:
145+
- the name of the input file
146+
- the name of the output file
147+
148+
The optional parameters are :
149+
- The normalization of the signals (N3D, FuMa or SN3D, which is the default value)
150+
- The NFC Distance, i.e., the distance at which the HOA mix was created. A float value between 0 and 20 meters must be given.
151+
The default value 0 means no NFC processing.
152+
- The screenRef flag, which tells if the audio content is screen related or not. The default value is False, which means no screen scaling.
153+
154+
For example, `ear-utils ambix_to_bwf --nfcDist 2.53 input.wav output.wav` will create an ADM file called output.wav containing the audio samples of the input.wav file and the ADM metadata corresponding to an ambiX file with SN3D normalization, an 2.53 meters nfcDist, and no screen scaling.
155+
156+
**Please note** that the software implicitly assumes that all the HOA channels are in ACN ordering and that no channel is missing. For example, it will assumes the signal is a 4th order HOA signal if it finds 25 channels ((4+1)²=25).

0 commit comments

Comments
 (0)