From 26514df889d675f4ada321aeecdbc685abb3f760 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 5 Jul 2022 15:23:03 +0200 Subject: [PATCH] fix copying to PCM from wav when -U is not given previously, pcm file length would default to zero, change to None to have audiofile.convertfile do the correct thing --- scripts/pyivastest/IvasModeRunner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pyivastest/IvasModeRunner.py b/scripts/pyivastest/IvasModeRunner.py index 172951c1aa..936c72106c 100755 --- a/scripts/pyivastest/IvasModeRunner.py +++ b/scripts/pyivastest/IvasModeRunner.py @@ -602,6 +602,7 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): # read signal and sampling rate from file sig, fs = af.readfile(in_file_name_transformed) + out_len = None # check if the given length with -U is longer than the file itself and avoid cutting then if do_limit_duration: cut_len_samples = int(float(self.max_duration) * fs) @@ -621,7 +622,6 @@ class IvasModeRunner(IvasModeCollector.IvasModeCollector): pcm_name_transformed = self.transform_path(pcm_name) out_fs = int(sample_rate_in) * 1000 - out_len = int(float(self.max_duration) * out_fs) pcm_log.write("Resampling to {} with length: {}".format(out_fs, out_len)) af.convertfile(resamp_in_path, pcm_name_transformed, out_fs=out_fs, out_len_samples=out_len) -- GitLab