diff --git a/ivas_processing_scripts/audiotools/audiofile.py b/ivas_processing_scripts/audiotools/audiofile.py index 7eeb7aa01c75cc36a0dfdd675dc631ccb6d6145d..9bd5265522d331b80eecda8b54f9e429d80f6c07 100755 --- a/ivas_processing_scripts/audiotools/audiofile.py +++ b/ivas_processing_scripts/audiotools/audiofile.py @@ -113,6 +113,7 @@ def write( x: np.ndarray, fs: Optional[int] = 48000, dtype: Optional[str] = "int16", + clipping_warning: Optional[bool] = True, ) -> None: """ Write audio file (.pcm, .wav or .raw) @@ -128,6 +129,8 @@ def write( dtype: Optional[str] Data type format required for .pcm or .raw input file, default = 'int16' + clipping_warning: Optional[bool] + Whether or not to raise warning for clipping Returns ------- None @@ -138,7 +141,7 @@ def write( clipped_samples = np.sum( np.logical_or(x < np.iinfo(np.int16).min, x > np.iinfo(np.int16).max) ) - if clipped_samples > 0: + if clipped_samples > 0 and clipping_warning: logger.warning(f" Warning: {clipped_samples} samples clipped") x = np.clip(x, np.iinfo(np.int16).min, np.iinfo(np.int16).max) diff --git a/ivas_processing_scripts/audiotools/wrappers/bs1770.py b/ivas_processing_scripts/audiotools/wrappers/bs1770.py index a137eeae562bde9ee5a375635678dd9159644318..c1d0901cb233ac06c486f08b6561311799230018 100755 --- a/ivas_processing_scripts/audiotools/wrappers/bs1770.py +++ b/ivas_processing_scripts/audiotools/wrappers/bs1770.py @@ -138,7 +138,7 @@ def bs1770demo( cmd[6] = "".join(conf_str) # write temporary file - write(tmp_file, tmp_sig, 48000) + write(tmp_file, tmp_sig, 48000, clipping_warning=False) # using rms if true if rms: diff --git a/ivas_processing_scripts/generation/process_ism_items.py b/ivas_processing_scripts/generation/process_ism_items.py index 4b28e08af9bbae59d1741f440c191a854e00cc86..d6480fdd0073f70855b562dd08388110a5a5305d 100644 --- a/ivas_processing_scripts/generation/process_ism_items.py +++ b/ivas_processing_scripts/generation/process_ism_items.py @@ -79,7 +79,9 @@ def generate_ism_items( cfg.add_low_level_random_noise = False for scene_name, scene in cfg.scenes.items(): - logger.info(f"Processing {scene_name} out of {N_scenes} scenes, name: {scene['name']}") + logger.info( + f"Processing {scene_name} out of {N_scenes} scenes, name: {scene['name']}" + ) # extract the number of audio sources N_sources = len(np.atleast_1d(scene["source"])) diff --git a/ivas_processing_scripts/generation/process_stereo_items.py b/ivas_processing_scripts/generation/process_stereo_items.py index dd8db76bd4dce0a9f402aa0588eff5b89948a529..d92ccae3d5427306995425d71b8bd91122683a09 100644 --- a/ivas_processing_scripts/generation/process_stereo_items.py +++ b/ivas_processing_scripts/generation/process_stereo_items.py @@ -88,8 +88,10 @@ def generate_stereo_items( # repeat for all source files for scene_name, scene in cfg.scenes.items(): - logger.info(f"Processing scene: {scene_name} out of {N_scenes} scenes, name: {scene['name']}") - + logger.info( + f"Processing scene: {scene_name} out of {N_scenes} scenes, name: {scene['name']}" + ) + # extract the number of audio sources N_sources = len(np.atleast_1d(scene["source"]))