Commit e0df0208 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

support for using prefixes for input_path, IR and output_path

parent 005c31f6
Loading
Loading
Loading
Loading
+86 −86
Original line number Diff line number Diff line
@@ -3,6 +3,11 @@
# General configuration
################################################

### Any relative paths will be interpreted relative to the working directory the script is called from!
### Usage of absolute paths is recommended.
### Do not use file names with dots "." in them! This is not supported, use "_" instead
### For Windows users: please use double back slash '\\' in paths 

### Output format
format: "STEREO"

@@ -12,16 +17,11 @@ fs: 48000
### IR sampling rate in Hz (only for files in .pcm format); default = 48000
# IR_fs: 48000

### Any relative paths will be interpreted relative to the working directory the script is called from!
### Usage of absolute paths is recommended.
### Do not use file names with dots "." in them! This is not supported, use "_" instead
### For Windows users: please use double back slash '\\' in paths 

### Input path to mono files
input_path: "./items_mono"

### Input path to stereo impulse response files, default = './ivas_processing_scripts/generation/IR'
# IR_path: "./IR"
### Input path to stereo impulse response files, default = './IRs'
IR_path: "./IRs"

### Output path for generated test items and metadata files
output_path: "experiments/selection/P800-1/proc_input"
@@ -33,24 +33,24 @@ loudness: -26
preamble: 0.5
postamble: 1.0

### Flag for adding low-level random background noise (amplitude +-4) instead of silence; default = false (silence)
### Flag for adding low-level random background noise (amplitude +-4) instead of silence; default = False (silence)
add_low_level_random_noise: true

### File designators
listening_lab: "a"
language: "JP"
### File designators, default is "l" for listening lab, "EN" for language, "p01" for exp and "g" for provider
listening_lab: "l"
language: "EN"
exp: "p01"
# provider: "Dolby"
provider: "g"

### Use prefix for all input filenames (default: None)
### Use prefix for all input filenames (default: "")
### l stands for the 'listening_lab' designator, L stands for the 'language', e stands for the 'exp' designator (the number of consecutive letters define the length of the field) 
use_input_prefix: "lLLeee"

### Use prefix for all IR filenames (default: None)
### Use prefix for all IR filenames (default: "")
### p stands for the 'provider', e stands for the 'exp' designator (the number of consecutive letters define the length of the field) 
# use_IR_prefix: "IR_pp_eee_"

### Use prefix for all output filenames (default: None)
### Use prefix for all output filenames (default: "")
### l stands for the 'listening_lab' designator, e stands for the 'exp' designator (the number of consecutive letters define the length of the field) 
use_output_prefix: "leee"

@@ -109,251 +109,251 @@ scenes:
        name: "cat1/a1s01.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f1s01.wav", "m1s01.wav"]
        IR: ["stereo/IR_g_p01_a_01_00_stAB100.wav", "stereo/IR_g_p01_a_07_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_01_00_stAB100.wav", "IR_g_p01_a_07_00_stAB100.wav"] 
        overlap: 1.0
        
    cat1_2: 
        name: "cat1/a1s02"
        name: "cat1/a1s02.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m2s01.wav", "f2s01.wav"]
        IR: ["stereo/IR_g_p01_a_05_00_stAB100.wav", "stereo/IR_g_p01_a_03_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_05_00_stAB100.wav", "IR_g_p01_a_03_00_stAB100.wav"] 
        overlap: 1.0
        
    cat1_3: 
        name: "cat1/a1s03"
        name: "cat1/a1s03.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f3s01.wav", "m3s01.wav"]
        IR: ["stereo/IR_g_p01_a_02_00_stAB100.wav", "stereo/IR_g_p01_a_06_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_02_00_stAB100.wav", "IR_g_p01_a_06_00_stAB100.wav"] 
        overlap: 1.0
        
    cat1_4: 
        name: "cat1/a1s04"
        name: "cat1/a1s04.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m1s02.wav", "f1s02.wav"]
        IR: ["stereo/IR_g_p01_a_04_00_stAB100.wav", "stereo/IR_g_p01_a_01_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_04_00_stAB100.wav", "IR_g_p01_a_01_00_stAB100.wav"] 
        overlap: 1.0
        
    cat1_5: 
        name: "cat1/a1s05"
        name: "cat1/a1s05.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f2s02.wav", "m2s02.wav"]
        IR: ["stereo/IR_g_p01_a_03_00_stAB100.wav", "stereo/IR_g_p01_a_04_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_03_00_stAB100.wav", "IR_g_p01_a_04_00_stAB100.wav"] 
        overlap: 1.0
        
    cat1_6: 
        name: "cat1/a1s06"
        name: "cat1/a1s06.wav"
        description: "Small anechoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m3s02.wav", "f3s02.wav"]
        IR: ["stereo/IR_g_p01_a_07_00_stAB100.wav", "stereo/IR_g_p01_a_02_00_stAB100.wav"] 
        IR: ["IR_g_p01_a_07_00_stAB100.wav", "IR_g_p01_a_02_00_stAB100.wav"] 
        overlap: 1.0
         
    cat2_1: 
        name: "cat2/a2s01"
        name: "cat2/a2s01.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["m3s03.wav", "f3s03.wav"]
        IR: ["stereo/IR_g_p01_b_05_00_stAB150.wav", "stereo/IR_g_p01_b_11_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_05_00_stAB150.wav", "IR_g_p01_c_11_00_stAB150.wav"] 
        overlap: -1.0
        
    cat2_2: 
        name: "cat2/a2s02"
        name: "cat2/a2s02.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["f1s03.wav", "m1s03.wav"]
        IR: ["stereo/IR_g_p01_b_01_00_stAB150.wav", "stereo/IR_g_p01_b_06_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_01_00_stAB150.wav", "IR_g_p01_c_06_00_stAB150.wav"] 
        overlap: -1.0
        
    cat2_3: 
        name: "cat2/a2s03"
        name: "cat2/a2s03.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["m2s03.wav", "f2s03.wav"]
        IR: ["stereo/IR_g_p01_b_03_00_stAB150.wav", "stereo/IR_g_p01_b_07_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_03_00_stAB150.wav", "IR_g_p01_c_07_00_stAB150.wav"] 
        overlap: -1.0
        
    cat2_4: 
        name: "cat2/a2s04"
        name: "cat2/a2s04.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["f3s04.wav", "m3s04.wav"]
        IR: ["stereo/IR_g_p01_b_05_00_stAB150.wav", "stereo/IR_g_p01_b_08_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_05_00_stAB150.wav", "IR_g_p01_c_08_00_stAB150.wav"] 
        overlap: -1.0
        
    cat2_5: 
        name: "cat2/a2s05"
        name: "cat2/a2s05.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["m1s04.wav", "f1s04.wav"]
        IR: ["stereo/IR_g_p01_b_09_00_stAB150.wav", "stereo/IR_g_p01_b_07_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_09_00_stAB150.wav", "IR_g_p01_c_07_00_stAB150.wav"] 
        overlap: -1.0
        
    cat2_6: 
        name: "cat2/a2s06"
        name: "cat2/a2s06.wav"
        description: "Large anechoic room with AB microphone pickup, no overlap between the talkers."
        source: ["f2s04.wav", "m2s04.wav"]
        IR: ["stereo/IR_g_p01_b_10_00_stAB150.wav", "stereo/IR_g_p01_b_09_00_stAB150.wav"] 
        IR: ["IR_g_p01_c_10_00_stAB150.wav", "IR_g_p01_c_09_00_stAB150.wav"] 
        overlap: -1.0
 
    cat3_1: 
        name: "cat3/a3s01"
        name: "cat3/a3s01.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["f2s05.wav", "m2s05.wav"]
        IR: ["stereo/IR_g_p01_a_01_00_stMS100.wav", "stereo/IR_g_p01_a_07_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_01_00_stMS100.wav", "IR_g_p01_a_07_00_stMS100.wav"] 
        overlap: -1.0
        
    cat3_2: 
        name: "cat3/a3s02"
        name: "cat3/a3s02.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["m3s05.wav", "f3s05.wav"]
        IR: ["stereo/IR_g_p01_a_05_00_stMS100.wav", "stereo/IR_g_p01_a_03_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_05_00_stMS100.wav", "IR_g_p01_a_03_00_stMS100.wav"] 
        overlap: -1.0
        
    cat3_3: 
        name: "cat3/a3s03"
        name: "cat3/a3s03.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["f1s05.wav", "m1s05.wav"]
        IR: ["stereo/IR_g_p01_a_02_00_stMS100.wav", "stereo/IR_g_p01_a_06_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_02_00_stMS100.wav", "IR_g_p01_a_06_00_stMS100.wav"] 
        overlap: -1.0
        
    cat3_4: 
        name: "cat3/a3s04"
        name: "cat3/a3s04.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["m2s06.wav", "f2s06.wav"]
        IR: ["stereo/IR_g_p01_a_04_00_stMS100.wav", "stereo/IR_g_p01_a_01_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_04_00_stMS100.wav", "IR_g_p01_a_01_00_stMS100.wav"] 
        overlap: -1.0
        
    cat3_5: 
        name: "cat3/a3s05"
        name: "cat3/a3s05.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["f3s06.wav", "m3s06.wav"]
        IR: ["stereo/IR_g_p01_a_03_00_stMS100.wav", "stereo/IR_g_p01_a_04_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_03_00_stMS100.wav", "IR_g_p01_a_04_00_stMS100.wav"] 
        overlap: -1.0
        
    cat3_6: 
        name: "cat3/a3s06"
        name: "cat3/a3s06.wav"
        description: "Small anechoic room with MS microphone pickup, no overlap between the talkers."
        source: ["m1s06.wav", "f1s06.wav"]
        IR: ["stereo/IR_g_p01_a_07_00_stMS100.wav", "stereo/IR_g_p01_a_02_00_stMS100.wav"] 
        IR: ["IR_g_p01_a_07_00_stMS100.wav", "IR_g_p01_a_02_00_stMS100.wav"] 
        overlap: -1.0
        
    cat4_1: 
        name: "cat4/a4s01"
        name: "cat4/a4s01.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m1s07.wav", "f1s07.wav"]
        IR: ["stereo/IR_g_p01_b_01_00_stAB100.wav", "stereo/IR_g_p01_b_07_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_01_00_stAB100.wav", "IR_g_p01_b_07_00_stAB100.wav"] 
        overlap: 1.0
        
    cat4_2: 
        name: "cat4/a4s02"
        name: "cat4/a4s02.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f2s07.wav", "m2s07.wav"]
        IR: ["stereo/IR_g_p01_b_07_00_stAB100.wav", "stereo/IR_g_p01_b_03_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_07_00_stAB100.wav", "IR_g_p01_b_03_00_stAB100.wav"] 
        overlap: 1.0
        
    cat4_3: 
        name: "cat4/a4s03"
        name: "cat4/a4s03.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m3s07.wav", "f3s07.wav"]
        IR: ["stereo/IR_g_p01_b_02_00_stAB100.wav", "stereo/IR_g_p01_b_06_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_02_00_stAB100.wav", "IR_g_p01_b_06_00_stAB100.wav"] 
        overlap: 1.0
        
    cat4_4: 
        name: "cat4/a4s04"
        name: "cat4/a4s04.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f1s08.wav", "m1s08.wav"]
        IR: ["stereo/IR_g_p01_b_04_00_stAB100.wav", "stereo/IR_g_p01_b_01_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_04_00_stAB100.wav", "IR_g_p01_b_01_00_stAB100.wav"] 
        overlap: 1.0
        
    cat4_5: 
        name: "cat4/a4s05"
        name: "cat4/a4s05.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m2s08.wav", "f2s08.wav"]
        IR: ["stereo/IR_g_p01_b_03_00_stAB100.wav", "stereo/IR_g_p01_b_04_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_03_00_stAB100.wav", "IR_g_p01_b_04_00_stAB100.wav"] 
        overlap: 1.0
        
    cat4_6: 
        name: "cat4/a4s06"
        name: "cat4/a4s06.wav"
        description: "Small echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f3s08.wav", "m3s08.wav"]
        IR: ["stereo/IR_g_p01_b_07_00_stAB100.wav", "stereo/IR_g_p01_b_02_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_07_00_stAB100.wav", "IR_g_p01_b_02_00_stAB100.wav"] 
        overlap: 1.0

    cat5_1: 
        name: "cat5/a5s01"
        name: "cat5/a5s01.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f3s09.wav", "m3s09.wav"]
        IR: ["stereo/IR_g_p01_d_02_00_stAB150.wav", "stereo/IR_g_p01_d_08_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_02_00_stAB150.wav", "IR_g_p01_d_08_00_stAB150.wav"] 
        overlap: 1.0
        
    cat5_2: 
        name: "cat5/a5s02"
        name: "cat5/a5s02.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m1s09.wav", "f1s09.wav"]
        IR: ["stereo/IR_g_p01_d_09_00_stAB150.wav", "stereo/IR_g_p01_d_04_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_09_00_stAB150.wav", "IR_g_p01_d_04_00_stAB150.wav"] 
        overlap: 1.0
        
    cat5_3: 
        name: "cat5/a5s03"
        name: "cat5/a5s03.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f2s09.wav", "m2s09.wav"]
        IR: ["stereo/IR_g_p01_d_06_00_stAB150.wav", "stereo/IR_g_p01_d_10_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_06_00_stAB150.wav", "IR_g_p01_d_10_00_stAB150.wav"] 
        overlap: 1.0
        
    cat5_4: 
        name: "cat5/a5s04"
        name: "cat5/a5s04.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m3s10.wav", "f3s10.wav"]
        IR: ["stereo/IR_g_p01_d_11_00_stAB150.wav", "stereo/IR_g_p01_d_08_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_11_00_stAB150.wav", "IR_g_p01_d_08_00_stAB150.wav"] 
        overlap: 1.0
        
    cat5_5: 
        name: "cat5/a5s05"
        name: "cat5/a5s05.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["f1s10.wav", "m1s10.wav"]
        IR: ["stereo/IR_g_p01_d_10_00_stAB150.wav", "stereo/IR_g_p01_d_12_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_10_00_stAB150.wav", "IR_g_p01_d_12_00_stAB150.wav"] 
        overlap: 1.0
        
    cat5_6: 
        name: "cat5/a5s06"
        name: "cat5/a5s06.wav"
        description: "Large echoic room with AB microphone pickup, partial overlap between the talkers."
        source: ["m2s10.wav", "f2s10.wav"]
        IR: ["stereo/IR_g_p01_d_12_00_stAB150.wav", "stereo/IR_g_p01_d_01_00_stAB150.wav"] 
        IR: ["IR_g_p01_d_12_00_stAB150.wav", "IR_g_p01_d_01_00_stAB150.wav"] 
        overlap: 1.0
        
    cat6_1: 
        name: "cat6/a6s01"
        name: "cat6/a6s01.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["m2s11.wav", "f2s11.wav"]
        IR: ["stereo/IR_g_p01_b_01_00_stAB100.wav", "stereo/IR_g_p01_b_07_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_01_00_stBI100.wav", "IR_g_p01_b_07_00_stBI100.wav"] 
        overlap: -1.0
        
    cat6_2: 
        name: "cat6/a6s02"
        name: "cat6/a6s02.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["f3s11.wav", "m3s11.wav"]
        IR: ["stereo/IR_g_p01_b_05_00_stAB100.wav", "stereo/IR_g_p01_b_03_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_05_00_stBI100.wav", "IR_g_p01_b_03_00_stBI100.wav"] 
        overlap: -1.0
        
    cat6_3: 
        name: "cat6/a6s03"
        name: "cat6/a6s03.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["m1s11.wav", "f1s11.wav"]
        IR: ["stereo/IR_g_p01_b_02_00_stAB100.wav", "stereo/IR_g_p01_b_06_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_02_00_stBI100.wav", "IR_g_p01_b_06_00_stBI100.wav"] 
        overlap: -1.0
        
    cat6_4: 
        name: "cat6/a6s04"
        name: "cat6/a6s04.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["f2s12.wav", "m2s12.wav"]
        IR: ["stereo/IR_g_p01_b_04_00_stAB100.wav", "stereo/IR_g_p01_b_01_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_04_00_stBI100.wav", "IR_g_p01_b_01_00_stBI100.wav"] 
        overlap: -1.0
        
    cat6_5: 
        name: "cat6/a6s05"
        name: "cat6/a6s05.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["m3s12.wav", "f3s12.wav"]
        IR: ["stereo/IR_g_p01_b_03_00_stAB100.wav", "stereo/IR_g_p01_b_04_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_03_00_stBI100.wav", "IR_g_p01_b_04_00_stBI100.wav"] 
        overlap: -1.0
        
    cat6_6: 
        name: "cat6/a6s06"
        name: "cat6/a6s06.wav"
        description: "Small echoic room with binaural microphone pickup, no overlap between the talkers."
        source: ["f1s12.wav", "m1s12.wav"]
        IR: ["stereo/IR_g_p01_b_07_00_stAB100.wav", "stereo/IR_g_p01_b_02_00_stAB100.wav"] 
        IR: ["IR_g_p01_b_07_00_stBI100.wav", "IR_g_p01_b_02_00_stBI100.wav"] 
        overlap: -1.0
+74 −13
Original line number Diff line number Diff line
@@ -29,10 +29,10 @@
#  accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
#  the United Nations Convention on Contracts on the International Sales of Goods.
#

import pdb
import logging
import os
from itertools import repeat
from itertools import repeat, groupby
from math import floor

import numpy as np
@@ -51,6 +51,25 @@ def csv_formatdata(data):
    for row in data:
        yield ["%0.2f" % v for v in row]

# function for searching sequences of same the same character and replacing it by another string
def replace_char_seq_with_string(str, char_seq, repl_str):
    result = []

    # find groups of consecutive letters
    groups = ["".join(list(g)) for k, g in groupby(str)]

    # limit the length of the replacement string by the length of the character sequence
    repl_str = repl_str[:len(char_seq)]

    # replace each occurence of the sequence of characters
    for g in groups:
        if char_seq in g:
            result.append(repl_str)
        else:
            result.append(g)
            
    return "".join(result)
    

def generate_stereo_items(
    cfg: config.TestConfig,
@@ -79,12 +98,54 @@ def generate_stereo_items(

    # set the IR path
    if "IR_path" not in cfg.__dict__:
        cfg.IR_path = os.path.join(os.path.dirname(__file__), "IR")
        cfg.IR_path = os.path.join(os.path.dirname(__file__), "IRs")

    # set the pre-amble and post-amble
    if "add_low_level_random_noise" not in cfg.__dict__:
        cfg.add_low_level_random_noise = False

    # set the listening lab designator
    if "listening_lab" not in cfg.__dict__:
        cfg.listening_lab = "l"

    # set the language designator
    if "language" not in cfg.__dict__:
        cfg.language = "EN"

    # set the experiment designator
    if "exp" not in cfg.__dict__:
        cfg.exp = "p01"

    # set the provider
    if "provider" not in cfg.__dict__:
        cfg.provider = "g"

    # set the prefix for all input filenames
    if "use_input_prefix" not in cfg.__dict__:
        cfg.use_input_prefix = ""
    else:
        # replace file designators
        cfg.use_input_prefix = replace_char_seq_with_string(cfg.use_input_prefix, "l", cfg.listening_lab )
        cfg.use_input_prefix = replace_char_seq_with_string(cfg.use_input_prefix, "LL", cfg.language )
        cfg.use_input_prefix = replace_char_seq_with_string(cfg.use_input_prefix, "eee", cfg.exp )

    # set the prefix for all IR filenames
    if "use_IR_prefix" not in cfg.__dict__:
        cfg.use_IR_prefix = ""
    else:
        # replace file designators
        cfg.use_IR_prefix = replace_char_seq_with_string(cfg.use_IR_prefix, "p", cfg.provider )
        cfg.use_IR_prefix = replace_char_seq_with_string(cfg.use_IR_prefix, "LL", cfg.language )
        cfg.use_IR_prefix = replace_char_seq_with_string(cfg.use_IR_prefix, "eee", cfg.exp )

    # set the prefix for all output filenames
    if "use_output_prefix" not in cfg.__dict__:
        cfg.use_output_prefix = None
    else:
        # replace file designators
        cfg.use_output_prefix = replace_char_seq_with_string(cfg.use_output_prefix, "l", cfg.listening_lab )
        cfg.use_output_prefix = replace_char_seq_with_string(cfg.use_output_prefix, "eee", cfg.exp )
  
    # set multiprocessing
    if "multiprocessing" not in cfg.__dict__:
        cfg.multiprocessing = True
@@ -108,8 +169,8 @@ def generate_stereo_scene(
    # extract the number of audio sources
    N_sources = len(np.atleast_1d(scene["source"]))

    # read the IR (check if stereo or two mono files were provided)
    source_IR = np.atleast_1d(scene["IR"])
    # read the IR source file (check if stereo or two mono files were provided)
    # source_IR = np.atleast_1d(scene["IR"])

    # read the overlap length
    if "overlap" in scene.keys():
@@ -119,18 +180,18 @@ def generate_stereo_scene(

    y = audio.ChannelBasedAudio("STEREO")
    for i in range(N_sources):
        source_prefix = cfg.listening_lab + cfg.language + cfg.exp
    
        # parse parameters from the scene description
        source_file = source_prefix + np.atleast_1d(scene["source"])[i]
        source_file = np.atleast_1d(scene["source"])[i]
        IR_file = np.atleast_1d(scene["IR"])[i]

        logger.info(f"Convolving {source_file} with {source_IR}")
        logger.info(f"Convolving {source_file} with {IR_file}")

        # read source file
        x = audio.fromfile("MONO", os.path.join(cfg.input_path, source_file), fs=cfg.fs)
        x = audio.fromfile("MONO", os.path.join(cfg.input_path, os.path.dirname(source_file), cfg.use_input_prefix + os.path.basename(source_file)), fs=cfg.fs)

        # read the IR file
        IR = audio.fromfile("STEREO", os.path.join(cfg.IR_path, IR_file), fs=cfg.IR_fs)
        IR = audio.fromfile("STEREO", os.path.join(cfg.IR_path, os.path.dirname(IR_file), cfg.use_IR_prefix + os.path.basename(IR_file)), fs=cfg.IR_fs)

        # convolve with stereo IR
        x = reverb_stereo(x, IR)
@@ -221,9 +282,9 @@ def generate_stereo_scene(
        y.audio += noise

    # write the reverberated audio into output file
    output_filename = cfg.listening_lab + cfg.exp + scene["name"] + ".wav"
    # output_filename = cfg.listening_lab + cfg.exp + scene["name"] + ".wav"
    audiofile.write(
        os.path.join(cfg.output_path, scene_name.split("_")[0], output_filename),
        os.path.join(cfg.output_path, os.path.dirname(scene["name"]), cfg.use_output_prefix + os.path.basename(scene["name"])),
        y.audio,
        y.fs,
    )  # !!!! TBD: replace all os.path.xxx operations with the Path object
    )