From 77853a576b6d362057cd5023904270062a94156f Mon Sep 17 00:00:00 2001 From: Stefan Bayer Date: Fri, 21 Apr 2023 10:40:07 +0200 Subject: [PATCH] fixed correct setting of the network simulators nFramesPerPacket command line parameter, added logging the of network simulator processing --- .../audiotools/wrappers/networkSimulator.py | 11 +++++++++-- ivas_processing_scripts/processing/chains.py | 2 +- ivas_processing_scripts/processing/ivas.py | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py b/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py index fa1b7509..649de216 100644 --- a/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py +++ b/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py @@ -31,6 +31,7 @@ # import os.path +import logging from pathlib import Path from typing import Optional, Union @@ -90,6 +91,7 @@ def network_simulator( out_bitstream: Union[str, Path], n_frames_per_packet: int, offset: int, + logger: Optional[logging.Logger] = None, ) -> None: """ Wrapper for networkSimulator_g192 binary to apply error patterns for the bitstream processing @@ -106,6 +108,8 @@ def network_simulator( Number of frames per paket [1,2] offset: Optional[int] delay offset + logger: Optional[logging.Logger] + logger """ # find binary @@ -133,7 +137,7 @@ def network_simulator( ] # run command - run(cmd) + run(cmd, logger=logger) return @@ -145,6 +149,7 @@ def apply_network_simulator( error_profile: Optional[int] = None, n_frames_per_packet: Optional[int] = None, offset: Optional[int] = 0, + logger: Optional[logging.Logger] = None, ) -> None: """ Function to apply a network simulator profile to a bitstreaam @@ -163,6 +168,8 @@ def apply_network_simulator( Number of frames per paket offset: Optional[int] delay offset + logger: Optional[logging.Logger] + logger """ if error_pattern is None: @@ -192,7 +199,7 @@ def apply_network_simulator( # apply error pattern network_simulator( - error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset + error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset, logger ) return diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index fc696d92..7f54330d 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -256,7 +256,7 @@ def get_processing_chain( "type": cfg.tx.get("type", None), "error_pattern": cfg.tx.get("error_pattern", None), "error_profile": cfg.tx.get("error_profile", None), - "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", 1), + "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", None), } else: raise ValueError( diff --git a/ivas_processing_scripts/processing/ivas.py b/ivas_processing_scripts/processing/ivas.py index ddfbc207..b2cae46b 100755 --- a/ivas_processing_scripts/processing/ivas.py +++ b/ivas_processing_scripts/processing/ivas.py @@ -225,6 +225,7 @@ class IVAS(Processing): self.tx["error_pattern"], self.tx["error_profile"], self.tx["n_frames_per_packet"], + logger=logger, ) # add -voip cmdline option to the decoder # TODO: tracefile also? -- GitLab