From 0d189195948179d125f68c75f78d40f8c8d3fa74 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 4 Oct 2024 10:44:16 +0200 Subject: [PATCH] use 48kHz fs when writing out resampled wav files --- scripts/pyaudio3dtools/audioarray.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/pyaudio3dtools/audioarray.py b/scripts/pyaudio3dtools/audioarray.py index ab6f3cb665..5741c1ada4 100644 --- a/scripts/pyaudio3dtools/audioarray.py +++ b/scripts/pyaudio3dtools/audioarray.py @@ -397,6 +397,7 @@ def compare( tmpfile_ref = Path(tmpdir).joinpath("ref.wav") tmpfile_test = Path(tmpdir).joinpath("test.wav") + ### need to resample to 48kHz for MLD computation to be correct if fs != 48000: ref_tmp = np.clip( @@ -409,8 +410,8 @@ def compare( ref_tmp = ref.copy() test_tmp = test.copy() - wavfile.write(str(tmpfile_ref), fs, ref_tmp.astype(np.int16)) - wavfile.write(str(tmpfile_test), fs, test_tmp.astype(np.int16)) + wavfile.write(str(tmpfile_ref), 48000, ref_tmp.astype(np.int16)) + wavfile.write(str(tmpfile_test), 48000, test_tmp.astype(np.int16)) cmd = [ str(wdiff), -- GitLab