Commit a37c4b37 authored by Jan Kiene's avatar Jan Kiene
Browse files

store background noise for tests in different folder than input

prevents "noise file too short for audio" error
parent bbe80ff7
Loading
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -36,13 +36,13 @@ preprocessing_2:
    preamble_noise: true
    ### Additive background noise
    # TODO: enable after bug with bg noise addition is fixed
    #background_noise:
        #### REQUIRED: SNR for background noise in dB
        #snr: 15
        #### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s)
        #background_noise_path: "experiments/selection/P800-2/proc_input/background_noise.wav"
        #### Seed for delay offest; default = 0
        #seed_delay: 10
    background_noise:
        ### REQUIRED: SNR for background noise in dB
        snr: 15
        ### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s)
        background_noise_path: "experiments/selection/P800-2/background_noise/background_noise.wav"
        ### Seed for delay offest; default = 0
        seed_delay: 10

#################################################
### Bitstream processing
+7 −7
Original line number Diff line number Diff line
@@ -36,13 +36,13 @@ preprocessing_2:
    preamble: 10000
    preamble_noise: true
    # TODO: enable after bug with bg noise addition is fixed
    #background_noise:
        #### REQUIRED: SNR for background noise in dB
        #snr: 15
        #### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s)
        #background_noise_path: "experiments/selection/P800-5/proc_input/background_noise.wav"
        #### Seed for delay offest; default = 0
        #seed_delay: 10
    background_noise:
        ### REQUIRED: SNR for background noise in dB
        snr: 15
        ### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s)
        background_noise_path: "experiments/selection/P800-5/background_noise/background_noise.wav"
        ### Seed for delay offest; default = 0
        seed_delay: 10

#################################################
### Bitstream processing
+2 −1
Original line number Diff line number Diff line
@@ -101,7 +101,8 @@ def test_generate_test_items(exp_name):

    # copy background noise if needed
    if (bg_noise := BG_NOISE_FOR_EXPERIMENT.get(exp_name)) is not None:
        bg_noise_out = input_path.joinpath(BG_NOISE_NAME)
        bg_noise_folder = input_path.parent.joinpath("background_noise")
        bg_noise_out = bg_noise_folder.joinpath(BG_NOISE_NAME)
        shutil.copy(bg_noise, bg_noise_out)

    generate_test(args)