Loading ivas_processing_scripts/generation/generate_ismN_items.py +6 −2 Original line number Diff line number Diff line Loading @@ -239,14 +239,18 @@ def generate_ismN_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading ivas_processing_scripts/generation/generate_mc_items.py +11 −6 Original line number Diff line number Diff line Loading @@ -236,14 +236,18 @@ def generate_MC_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -418,14 +422,15 @@ def generate_MC_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y_int.audio) > duration: y_int.audio = audioarray.trim( y_int.audio, y_int.fs, limits=[0, len(y_int.audio) - duration], samples=True y_int.audio, y_int.fs, limits=[0, len(y_int.audio) - duration], samples=True, ) # adjust the loudness of the output signal Loading ivas_processing_scripts/generation/generate_omasa_items.py +10 −6 Original line number Diff line number Diff line Loading @@ -227,14 +227,18 @@ def generate_OMASA_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -497,13 +501,13 @@ def generate_OMASA_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y_int.audio) > duration: metadata.trim_meta(y_int, limits=[0, len(y_int.audio) - duration], samples=True) metadata.trim_meta( y_int, limits=[0, len(y_int.audio) - duration], samples=True ) # adjust the loudness of the output signal if "loudness" in cfg.__dict__: Loading ivas_processing_scripts/generation/generate_osba_items.py +7 −5 Original line number Diff line number Diff line Loading @@ -224,14 +224,18 @@ def generate_OSBA_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -483,9 +487,7 @@ def generate_OSBA_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y.audio) > duration: Loading ivas_processing_scripts/generation/generate_sba_items.py +7 −5 Original line number Diff line number Diff line Loading @@ -228,14 +228,18 @@ def generate_sba_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -389,9 +393,7 @@ def generate_sba_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y.audio) > duration: Loading Loading
ivas_processing_scripts/generation/generate_ismN_items.py +6 −2 Original line number Diff line number Diff line Loading @@ -239,14 +239,18 @@ def generate_ismN_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading
ivas_processing_scripts/generation/generate_mc_items.py +11 −6 Original line number Diff line number Diff line Loading @@ -236,14 +236,18 @@ def generate_MC_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -418,14 +422,15 @@ def generate_MC_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y_int.audio) > duration: y_int.audio = audioarray.trim( y_int.audio, y_int.fs, limits=[0, len(y_int.audio) - duration], samples=True y_int.audio, y_int.fs, limits=[0, len(y_int.audio) - duration], samples=True, ) # adjust the loudness of the output signal Loading
ivas_processing_scripts/generation/generate_omasa_items.py +10 −6 Original line number Diff line number Diff line Loading @@ -227,14 +227,18 @@ def generate_OMASA_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -497,13 +501,13 @@ def generate_OMASA_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y_int.audio) > duration: metadata.trim_meta(y_int, limits=[0, len(y_int.audio) - duration], samples=True) metadata.trim_meta( y_int, limits=[0, len(y_int.audio) - duration], samples=True ) # adjust the loudness of the output signal if "loudness" in cfg.__dict__: Loading
ivas_processing_scripts/generation/generate_osba_items.py +7 −5 Original line number Diff line number Diff line Loading @@ -224,14 +224,18 @@ def generate_OSBA_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -483,9 +487,7 @@ def generate_OSBA_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y.audio) > duration: Loading
ivas_processing_scripts/generation/generate_sba_items.py +7 −5 Original line number Diff line number Diff line Loading @@ -228,14 +228,18 @@ def generate_sba_scene( # of the reference signal (0-based index) if isinstance(scene["shift"][i], str) and "(" in scene["shift"][i]: # extract X and i_ref match = re.match(r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i]) match = re.match( r"([+-]?\d*\.?\d+)[\(\[]([+-]?\d+)[\)\]]", scene["shift"][i] ) if match: overlap = float(match.group(1)) overlap_ref = int(match.group(2)) else: scene_shift_str = scene["shift"][i] logger.error(f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!") logger.error( f"Unable to parse {scene_shift_str}. The specification of overlap or reference is incorrect!" ) sys.exit(-1) # calculate absolute shift of the source signal in seconds Loading Loading @@ -389,9 +393,7 @@ def generate_sba_scene( # trim the output signal if the total duration exceeds X seconds if "duration" in cfg.__dict__: # convert from seconds to samples (ensure multiple of 20ms) duration = int( np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len ) duration = int(np.floor(int(cfg.duration * cfg.fs) / frame_len) * frame_len) # check if the current length of the output signal exceeds the duration if len(y.audio) > duration: Loading