Commit 5bffa9d0 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

fixes and formatting

parent 79f85aae
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ def main(args):
                hasattr(cfg, "preprocessing")
                and hasattr(cfg.pre2, "background_noise")
                and cfg.pre2.background_noise is not None
                and cfg.pre2.background_noise.get("background_noise_path")
            ):
                preprocess_background_noise(cfg)
            # preprocess 2
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
#  the United Nations Convention on Contracts on the International Sales of Goods.
#

from pathlib import Path
from typing import Optional
from warnings import warn

+1 −2
Original line number Diff line number Diff line
@@ -143,7 +143,6 @@ class TestConfig:
        if (pre_proc_2 := cfg.get("preprocessing_2", None)) is not None and (
            bg_noise := pre_proc_2.get("background_noise", None)
        ) is not None:

            # check if low level flag or path is given
            if not bg_noise.get("background_noise_path", None) and not bg_noise.get(
                "low_level_noise", False
@@ -165,7 +164,7 @@ class TestConfig:
                if not bg_noise.get("snr", None):
                    raise ValueError("SNR has to be specified for background noise")

                if not Path(bg_noise["background_noise_path"]).exists():
                if not get_abs_path(bg_noise["background_noise_path"]).exists():
                    raise ValueError(
                        f"Background noise path {bg_noise['background_noise_path']} does not exist"
                    )
+0 −2
Original line number Diff line number Diff line
@@ -108,13 +108,11 @@ class Preprocessing2(Processing):
    def add_background_noise(
        self, audio_object: audio.Audio, in_meta, logger
    ) -> np.ndarray:

        # range for random delay
        max_delay = int(2400000 * audio_object.fs / 48000)

        if self.background_noise.get("background_noise_path"):
            # load background noise
            # TODO: check preprocessing of background noise object
            if self.background_noise["background_object"] is not None:
                noise_object = self.background_noise["background_object"]
            else:
+1 −1

File changed.

Contains only whitespace changes.