From cae86535c615051badcaa46b25d01a060915573e Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 19 May 2023 11:47:23 +0200 Subject: [PATCH 1/2] fixed missing conversion if input is planar and output is not --- ivas_processing_scripts/audiotools/convert/scenebased.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ivas_processing_scripts/audiotools/convert/scenebased.py b/ivas_processing_scripts/audiotools/convert/scenebased.py index ab22713d..8183fd93 100755 --- a/ivas_processing_scripts/audiotools/convert/scenebased.py +++ b/ivas_processing_scripts/audiotools/convert/scenebased.py @@ -175,6 +175,8 @@ def render_sba_to_sba( if sba_out.is_planar: zero_vert_channels(sba_out) + elif sba_in.is_planar: + sba_out.audio = sba_in.audio def rotate_sba( -- GitLab From fc6354dd2f31716c028d8580a5af56209615922d Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 19 May 2023 12:55:29 +0200 Subject: [PATCH 2/2] added additional step after decoding to set planar channels to zero --- ivas_processing_scripts/audiotools/audiofile.py | 5 +++++ ivas_processing_scripts/processing/evs.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ivas_processing_scripts/audiotools/audiofile.py b/ivas_processing_scripts/audiotools/audiofile.py index 9bd52655..21476228 100755 --- a/ivas_processing_scripts/audiotools/audiofile.py +++ b/ivas_processing_scripts/audiotools/audiofile.py @@ -289,6 +289,7 @@ def combine( in_filenames: list, out_file: str, in_fs: Optional[int] = 48000, + is_planar: Optional[bool] = False, ) -> None: """ Combines audio files into one multi-channel file @@ -327,6 +328,10 @@ def combine( y = y[: x.shape[0], :] y = np.column_stack([y, x]) + # set vertical channels to zero + if is_planar: + y[:, VERT_HOA_CHANNELS_ACN[VERT_HOA_CHANNELS_ACN < len(in_filenames)]] = 0 + write(out_file, y, fs=in_fs) diff --git a/ivas_processing_scripts/processing/evs.py b/ivas_processing_scripts/processing/evs.py index d828b6e2..7239c3b9 100755 --- a/ivas_processing_scripts/processing/evs.py +++ b/ivas_processing_scripts/processing/evs.py @@ -236,7 +236,7 @@ class EVS(Processing): # combine the decoded channels into the output file if out_file.suffix in [".wav", ".pcm"]: - combine(split_chan_out, out_file, in_fs=self.out_fs) + combine(split_chan_out, out_file, in_fs=self.out_fs, is_planar=is_planar) # copy ISM metadata for ISM pass-through if in_meta: for idx in range(len(in_meta)): -- GitLab