Commit 6a02deda authored by bayers's avatar bayers
Browse files

make bistream processing in the self test more error robust, create missing...

make bistream processing in the self test more error robust, create missing combined format inputs for the self test automatically
parent 7097cb8f
Loading
Loading
Loading
Loading
Loading
+92 −88
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import numpy as np

from pyaudio3dtools import audiofile, audioarray

def main():
    FS = [48, 32, 16]

    # scripts/testv/ path
@@ -137,3 +138,6 @@ for fs in FS:
    # info print. helps setting up .gitignore
    if len(wrote_files) > 0:
        print('New files written: {}'.format('\n'.join(wrote_files)))

if __name__ == "__main__":
    main()
 No newline at end of file
+15 −1
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ import multiprocessing
import tempfile
import urllib.parse
import shutil
import prepare_combined_format_inputs
import errno


BW_TO_SR = {"nb": 8, "wb": 16, "swb": 32, "fb": 48}
@@ -993,6 +995,18 @@ class SelfTest(IvasScriptsCommon.IvasScript):
                {oc: list(map(self.test_for_file, dec_cmd))}
            )

        # check if we need to produce missing combined formats
        if not os.path.exists(in_file):
            if is_osba_or_omasa:
                self.logger.info("Creating missing combined formats test vectors...")
                prepare_combined_format_inputs.main()
                if not os.path.exists(in_file):
                    self.logger.error(f"Test vector {in_file} does not exist!")
                    raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), in_file)
            else:
                self.logger.error(f"Test vector {in_file} does not exist!")
                raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), in_file)

        # handle intermediate processing steps, e.g. networksimulator, eid-xor, ...
        in_file = bs_enc_file
        proc_cmds = []
@@ -1008,7 +1022,7 @@ class SelfTest(IvasScriptsCommon.IvasScript):
            proc_cmd[0] = os.path.join(TOOLS_DIR, proc_cmd[0])

            proc_cmd = [
                "{in_file}" if x == in_file else self.test_for_file(x) for x in proc_cmd
                "{in_file}" if x == in_file else x for x in proc_cmd
            ]
            if mode[1]:
                for cmdline_arg in proc_cmd[1:]: