Replies: 2 comments
-
Below is an AI suggestion. Let me know if it works (I haven't tried): import tempfile
import os
# Assuming you have a blob containing audio data
audio_blob = b'...binary audio data...' # Replace with your actual blob data
# Create a temporary file
with tempfile.NamedTemporaryFile(delete=False, suffix='.wav') as temp_audio_file:
temp_audio_file.write(audio_blob)
temp_audio_file_path = temp_audio_file.name
# Now use the temporary file path with your transcription library
# Example with a hypothetical transcription library
# Replace `transcription_lib.transcribe` with the actual function from your library
try:
transcription_result = transcription_lib.transcribe(temp_audio_file_path)
print("Transcription:", transcription_result)
finally:
# Clean up the temporary file
os.remove(temp_audio_file_path) Which lib are you using? If it accepts in-memory file-like objects, you can try this: # Create an in-memory file-like object from the blob
audio_file = io.BytesIO(audio_blob)
# Transcribe... |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, thanks a bunch for trying to help me out! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I'm having a hard time getting and transcribing audio when running the code with view=web_browser. It gives me a URL, but I want to get the file to transcribe it. I managed to do it on Windows, but I'm struggling with the web version.
Code sample
Error message
No response
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions