diff --git a/ivas_processing_scripts/audiotools/audiofile.py b/ivas_processing_scripts/audiotools/audiofile.py index 9bd5265522d331b80eecda8b54f9e429d80f6c07..21476228050a7deb3335197e8151844d3fd7781a 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/audiotools/convert/scenebased.py b/ivas_processing_scripts/audiotools/convert/scenebased.py index ab22713d9fe733d0669f2e7c9371286bc538246c..8183fd93ca712acdd334717cc2b7b03d510ad25c 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( diff --git a/ivas_processing_scripts/processing/evs.py b/ivas_processing_scripts/processing/evs.py index d828b6e29b06c61c8dcd23bf93127534d1792d16..7239c3b97322c3b05b7f9457acf1cea65f3dbbe3 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)):