Spaces:
Sleeping
Sleeping
main.py
CHANGED
@@ -81,6 +81,7 @@ def extract_features(audio):
|
|
81 |
async def process_audio_data(audio_data):
|
82 |
try:
|
83 |
logger.info(f"Audio data type: {type(audio_data)}")
|
|
|
84 |
# Attempt to convert audio data from webm/ogg to wav format using pydub
|
85 |
audio_segment = AudioSegment.from_file(io.BytesIO(audio_data), format="webm")
|
86 |
except Exception as e:
|
@@ -91,7 +92,6 @@ async def process_audio_data(audio_data):
|
|
91 |
# Export the audio segment to wav format
|
92 |
wav_io = io.BytesIO()
|
93 |
audio_segment.export(wav_io, format="wav")
|
94 |
-
logger.info(f"Audio data type: {type(audio_segment)}")
|
95 |
wav_io.seek(0)
|
96 |
|
97 |
# Read the audio data
|
|
|
81 |
async def process_audio_data(audio_data):
|
82 |
try:
|
83 |
logger.info(f"Audio data type: {type(audio_data)}")
|
84 |
+
logger.info(f"Raw audio length: {len(audio_data)}")
|
85 |
# Attempt to convert audio data from webm/ogg to wav format using pydub
|
86 |
audio_segment = AudioSegment.from_file(io.BytesIO(audio_data), format="webm")
|
87 |
except Exception as e:
|
|
|
92 |
# Export the audio segment to wav format
|
93 |
wav_io = io.BytesIO()
|
94 |
audio_segment.export(wav_io, format="wav")
|
|
|
95 |
wav_io.seek(0)
|
96 |
|
97 |
# Read the audio data
|