From 8ce4aaba880f2a76dbd5e154080791947759a344 Mon Sep 17 00:00:00 2001 From: yangb Date: Tue, 10 Oct 2023 15:15:32 +0800 Subject: [PATCH] change the cmd in read_opus_ffmpeg to assure the opus files are read in the right sampling rate --- lhotse/audio/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lhotse/audio/backend.py b/lhotse/audio/backend.py index c3f7000fa..91a93b38e 100644 --- a/lhotse/audio/backend.py +++ b/lhotse/audio/backend.py @@ -975,8 +975,8 @@ def read_opus_ffmpeg( cmd += f" -i '{path}'" # Optionally resample the output. if force_opus_sampling_rate is not None: - cmd += f" -ar {force_opus_sampling_rate}" sampling_rate = force_opus_sampling_rate + cmd += f" -ar {sampling_rate}" # Read audio samples directly as float32. cmd += " -f f32le -threads 1 pipe:1" # Actual audio reading.