finish voice chat

This commit is contained in:
zachary62
2025-05-13 16:34:28 -04:00
parent c4898bf307
commit 76b5886dd0
8 changed files with 321 additions and 35 deletions
@@ -8,7 +8,7 @@ def speech_to_text_api(audio_data: bytes, sample_rate: int):
# The API expects a file-like object. We can use io.BytesIO for in-memory bytes.
# We also need to give it a name, as if it were a file upload.
audio_file = io.BytesIO(audio_data)
audio_file.name = "audio.mp3" # Provide a dummy filename with a common audio extension
audio_file.name = "audio.wav" # Corrected to WAV format
transcript = client.audio.transcriptions.create(
model="gpt-4o-transcribe",