From b422205acd525f184a84e8e578d8ff00f92bcf7b Mon Sep 17 00:00:00 2001 From: Sam Khoze <68170403+SamKhoze@users.noreply.github.com> Date: Wed, 10 Jul 2024 23:14:07 +0530 Subject: [PATCH] Update utils.py --- utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils.py b/utils.py index d5c25f4..1dd74ca 100644 --- a/utils.py +++ b/utils.py @@ -165,6 +165,7 @@ def get_audio(file, start_time=0, duration=0): audio = torch.frombuffer(bytearray(res.stdout), dtype=torch.float32) except subprocess.CalledProcessError as e: audio = torch.zeros(1,2) + return {'waveform': audio, 'sample_rate': '16000'} match = re.search(', (\\d+) Hz, (\\w+), ',res.stderr.decode('utf-8')) if match: ar = int(match.group(1))