The gr.Audio() component with sources=["upload"] returns a tuple (filename, metadata) instead of just the filename string. Added this check at line 83-91:
if isinstance(media_file, tuple):
src_path = media_file[0] # Extract actual filename from tuple
elif isinstance(media_file, str):
src_path = media_file
What changed:
Replaced gr.Video() with gr.Audio() — better UX for audio files, still accepts video via "upload" source
Removed SRT generation entirely (you only wanted text output)
Simplified return values to just (text, txt_path)
Updated UI labels to emphasize "copy & paste" workflow
Kept all the core logic identical — ffmpeg handles both audio and video extraction seamlessly
Initial commit: video transcription Space with Whisper + ffmpeg