Commit 872d533c authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

formatting

parent 8d7b16e8
Loading
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -32,8 +32,6 @@

import logging
import os
import pdb
from itertools import repeat

import yaml

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
from datetime import datetime
from pathlib import Path

from item_generation_scripts.utils import find_binary, get_binary_paths
from item_generation_scripts.utils import get_binary_paths

LOGGER_SUFFIX = ".log"
LOGGER_FORMAT = (
+0 −1
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import yaml

from item_generation_scripts.constants import (
    DEFAULT_CONFIG,
    DEFAULT_CONFIG_ISM2,
    REQUIRED_KEYS,
)

+5 −14
Original line number Diff line number Diff line
@@ -34,20 +34,11 @@
import csv
import logging
import os
import shutil
import subprocess as sp
import sys
from pathlib import Path

import numpy as np

from item_generation_scripts.audiotools import (
    audio,
    audioarray,
    audiofile,
    binauralobjectrenderer,
    metadata,
)
from item_generation_scripts.audiotools import audio, audiofile
from item_generation_scripts.audiotools.wrappers.bs1770 import get_loudness


@@ -82,7 +73,7 @@ def generate_ism_items(
            source_file = np.atleast_1d(scene["source"])[i]
            source_azi = np.atleast_1d(scene["azimuth"])[i]
            source_ele = np.atleast_1d(scene["elevation"])[i]
            source_type = "speech"  #### !!!! TBD - support generic audio + background noise and speech in the .yml file
            # source_type = "speech"  # !!!! TBD - support generic audio + background noise and speech in the .yml file
            source_delay = np.atleast_1d(scene["delay"])[i]

            logger.info(
@@ -90,7 +81,7 @@ def generate_ism_items(
            )

            # read source file
            # x, fs = audiofile.read(os.path.join(input_path, source_file))    #### !!!! TBD - check the support for headerless .raw files
            # x, fs = audiofile.read(os.path.join(input_path, source_file))    # !!!! TBD - check the support for headerless .raw files
            # pdb.set_trace()
            audio_object = audio.fromfile("MONO", os.path.join(input_path, source_file))

@@ -167,7 +158,7 @@ def generate_ism_items(
            # additional metadata
            dist = np.ones(
                N_frames
            )  #### !!!! TBD - check what to do with these metadata
            )  # !!!! TBD - check what to do with these metadata
            spread = np.zeros(N_frames)
            gain = np.ones(N_frames)

@@ -229,7 +220,7 @@ def generate_ism_items(
        output_filename = scene["name"]
        audiofile.write(
            os.path.join(output_path, output_filename), y, fs
        )  ### !!!! replace all os.path.xxx operations with the Path object
        )  # !!!! TBD: replace all os.path.xxx operations with the Path object

        # write individual ISM metadata to output files in .csv format
        for i in range(N_sources):