Loading experiments/selection/P800-1/config/P800-1.yml +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ input: fmt: "STEREO" # TODO: to be clarified in Test Plan fs: 48000 aligned_to: len: 20 ################################################ ### Pre-processing on individual items Loading @@ -36,6 +38,8 @@ preprocessing_2: # concatenation_order: [] preamble: 10000 preamble_noise: true postamble: 10000 postamble_noise: true repeat_signal: true background_noise: ### REQUIRED: SNR for background noise in dB Loading ivas_processing_scripts/processing/chains.py +11 −11 Original line number Diff line number Diff line Loading @@ -523,7 +523,7 @@ def validate_input_files(cfg: TestConfig): """ input_format = cfg.input["fmt"] num_chan_expected = audio.fromtype(input_format).num_channels check_block_aligned_to = 20 for item in cfg.items_list: if "fs" in cfg.input: sampling_rate = cfg.input["fs"] Loading @@ -547,14 +547,14 @@ def validate_input_files(cfg: TestConfig): f"The number of channels in the file ({n_chan_x}) do NOT match with those of format ({num_chan_expected}, {input_format}) specified in the config yaml." ) if check_block_aligned_to > 0: frame_length_samples = (check_block_aligned_to / 1000) * fs if n_samples_x % frame_length_samples != 0: if input_format.startswith("ISM") or input_format.startswith("MASA"): raise ValueError( f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of frame length (20 ms) - not allowed for input formats with metadata." ) if (input_aligned_cfg := cfg.input.get("aligned_to", None)) is not None: input_fmt_has_metadata = input_format.startswith("ISM") or input_format.startswith("MASA") force_alignment = input_aligned_cfg.get("force", False) or input_fmt_has_metadata alignment_len_samples = (input_aligned_cfg["len"] / 1000) * fs if n_samples_x % alignment_len_samples != 0: msg = f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of given alignment length ({input_aligned_cfg['len']} ms)." if force_alignment: raise ValueError(msg) else: warn( f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of frame length (20 ms)." ) warn(msg) Loading
experiments/selection/P800-1/config/P800-1.yml +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ input: fmt: "STEREO" # TODO: to be clarified in Test Plan fs: 48000 aligned_to: len: 20 ################################################ ### Pre-processing on individual items Loading @@ -36,6 +38,8 @@ preprocessing_2: # concatenation_order: [] preamble: 10000 preamble_noise: true postamble: 10000 postamble_noise: true repeat_signal: true background_noise: ### REQUIRED: SNR for background noise in dB Loading
ivas_processing_scripts/processing/chains.py +11 −11 Original line number Diff line number Diff line Loading @@ -523,7 +523,7 @@ def validate_input_files(cfg: TestConfig): """ input_format = cfg.input["fmt"] num_chan_expected = audio.fromtype(input_format).num_channels check_block_aligned_to = 20 for item in cfg.items_list: if "fs" in cfg.input: sampling_rate = cfg.input["fs"] Loading @@ -547,14 +547,14 @@ def validate_input_files(cfg: TestConfig): f"The number of channels in the file ({n_chan_x}) do NOT match with those of format ({num_chan_expected}, {input_format}) specified in the config yaml." ) if check_block_aligned_to > 0: frame_length_samples = (check_block_aligned_to / 1000) * fs if n_samples_x % frame_length_samples != 0: if input_format.startswith("ISM") or input_format.startswith("MASA"): raise ValueError( f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of frame length (20 ms) - not allowed for input formats with metadata." ) if (input_aligned_cfg := cfg.input.get("aligned_to", None)) is not None: input_fmt_has_metadata = input_format.startswith("ISM") or input_format.startswith("MASA") force_alignment = input_aligned_cfg.get("force", False) or input_fmt_has_metadata alignment_len_samples = (input_aligned_cfg["len"] / 1000) * fs if n_samples_x % alignment_len_samples != 0: msg = f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of given alignment length ({input_aligned_cfg['len']} ms)." if force_alignment: raise ValueError(msg) else: warn( f"The length ({n_samples_x} samples) of audio ({item.name}) is not a multiple of frame length (20 ms)." ) warn(msg)