Commit eee84e68 authored by Vinit Veera's avatar Vinit Veera
Browse files

Added functionality to allow user configurable binary paths.

parent 11670ff0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,4 +11,4 @@ venv/
*.pcm
*.bs
*.192
mc.double
+5 −1
Original line number Diff line number Diff line
@@ -53,12 +53,16 @@ The `ivas_processing_scripts` module helps to quickly setup listening tests with

This module may be used by executing the top level python module i.e. `python -m ivas_processing_scripts CONFIG.YML`.

## Configuration file
## Configuration file for processing module

The processing module can be configured to set up a test via a YAML configuration file.

YAML is a superset of JSON, however unlike JSON comments are permitted, which allows for the addition of useful information in the configuration file.

## Configuration file for binaries/executables

The user can specify custom binary paths and names via a YAML configuration file called [_binary_paths.yml_](ivas_processing_scripts/binary_paths.yml). More information on usage can be found in the comments mentioned in the file.

## YAML reference

A read through of the YAML reference card is highly recommended. This can be found here: <https://yaml.org/refcard.html>
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ output_path: "./tmp_output"
### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be
### as per the filesystem on the users' device
### Should only be used if concatenate_input = true
### Specify the filename with extension.
### For example, concatenation_order: ["file3.wav", "file1.wav", "file4.wav", "file2.wav"]
# concatenation_order: []
### Specify preamble duration in ms; default = 0
# preamble: 40
+0 −5
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ from ivas_processing_scripts.processing.processing import (
from ivas_processing_scripts.utils import (
    DirManager,
    apply_func_parallel,
    get_binary_paths,
)


@@ -98,10 +97,6 @@ def main(args):
        # set up logging
        logger = logging_init(args, cfg)

        # updating binary paths
        if cfg.binary_paths is not None:
            get_binary_paths(cfg, cfg.binary_paths)

        # Re-ordering items based on concatenation order
        if cfg.concatenate_input and cfg.concatenation_order is not None:
            cfg.items_list = reorder_items_list(cfg.items_list, cfg.concatenation_order)
+6 −3
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ from ivas_processing_scripts.audiotools import audio, convert
from ivas_processing_scripts.audiotools.audiofile import write
from ivas_processing_scripts.audiotools.wrappers.filter import resample_itu
from ivas_processing_scripts.utils import find_binary, get_devnull, run
from ivas_processing_scripts.constants import DEFAULT_CONFIG_BINARIES

logger = logging.getLogger("__main__")
logger.setLevel(logging.DEBUG)
@@ -51,7 +52,6 @@ logger.setLevel(logging.DEBUG)
def bs1770demo(
    input: audio.Audio,
    target_loudness: Optional[float] = -26,
    binary_path: Optional[Path] = None,
) -> Tuple[float, float]:
    """
    Wrapper for ITU-R BS.1770-4, requires bs1770demo binary
@@ -73,8 +73,11 @@ def bs1770demo(

    null_file = get_devnull()

    if binary_path is not None:
        binary = find_binary(binary_path.name, binary_path=binary_path.parent)
    if "bs1770demo" in DEFAULT_CONFIG_BINARIES["binary_paths"]:
        binary = find_binary(
            DEFAULT_CONFIG_BINARIES["binary_paths"]["bs1770demo"].name,
            path=DEFAULT_CONFIG_BINARIES["binary_paths"]["bs1770demo"].parent,
        )
    else:
        binary = find_binary("bs1770demo")

Loading