From b0939cb5b87223c418de1f44ffabbd74735851b7 Mon Sep 17 00:00:00 2001 From: Joel Mathew Thomas <90510078+joelmathewthomas@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:56:59 +0530 Subject: [PATCH] fix bug: return original sample rate --- api/api/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/api/tasks.py b/api/api/tasks.py index 39380bb..40abe8b 100644 --- a/api/api/tasks.py +++ b/api/api/tasks.py @@ -13,12 +13,13 @@ def save_and_classify(file_path, file_content): destination.write(file_content) # Read the saved audio file + _, org_sr = read_audio(file_path) # Get original sampling rate waveform, sr = read_audio(file_path, 16000, mono=True) # Classify the audio audio_class = classify_audio(waveform, sr) - return audio_class, sr + return audio_class, org_sr @shared_task def normalize_audio_task(file_path):