Skip to content

fix(whisper): convert non-WAV audio to WAV for Open WebUI compatibility#2481

Draft
vgodsoe wants to merge 8 commits into
mainfrom
fix/whisper-webm-conversion
Draft

fix(whisper): convert non-WAV audio to WAV for Open WebUI compatibility#2481
vgodsoe wants to merge 8 commits into
mainfrom
fix/whisper-webm-conversion

Conversation

@vgodsoe

@vgodsoe vgodsoe commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Open WebUI records audio as WebM/Opus; whisper.cpp only accepts WAV, causing a 500 error on every transcription request
  • WhisperServer now calls ffmpeg to convert any non-WAV input to 16 kHz mono WAV before forwarding to the subprocess
  • Both forward_multipart_audio_data (used by the main transcription path) and forward_multipart_audio_request (file-path variant) are fixed consistently

Test plan

  • Record audio in Open WebUI → submit transcription → should return valid text instead of 500
  • curl -X POST http://localhost:13305/v1/audio/transcriptions -F "file=@test.webm" -F "model=Whisper-Tiny" returns transcript
  • WAV input still works unchanged (no regression)
  • Missing ffmpeg returns a clear 500 error message
  • python test/server_whisper.py

🤖 Generated with Claude Code

…er-server

Open WebUI records audio as WebM/Opus, which whisper.cpp cannot process natively.
WhisperServer now calls ffmpeg to convert any non-WAV input to 16 kHz mono WAV
before forwarding to the subprocess, fixing the 500 error users see with Open WebUI.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added engine::whispercpp whisper.cpp backend; audio transcription bug Something isn't working labels Jun 29, 2026
vgodsoe and others added 5 commits June 29, 2026 10:33
fs::remove() fails with access-denied on open handles on Windows,
causing temp WAV files to accumulate in temp_dir_ for the server lifetime.

Co-Authored-By: Claude <noreply@anthropic.com>
…te forwarding logic

Co-Authored-By: Claude <noreply@anthropic.com>
…rrent requests

Co-Authored-By: Claude <noreply@anthropic.com>
…t policy of HTTP POST

Large WebM files on slow machines can exceed 30 s to transcode; -1 matches
the same no-cap approach used for the whisper-server inference POST.

Co-Authored-By: Claude <noreply@anthropic.com>
…sion is not skipped

audio.wav caused send_audio_to_whisper to bypass the ext != .wav conversion
guard, forwarding raw WebM/Opus bytes to whisper-server labeled as WAV.

Co-Authored-By: Claude <noreply@anthropic.com>
@vgodsoe

vgodsoe commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…ersion

# Conflicts:
#	src/cpp/server/backends/whispercpp/whispercpp_server.cpp

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in 8d262a6. The conflict was in whispercpp_server.cpp — kept the WebM→WAV conversion logic (convert_to_wav + send_audio_to_whisper) from this branch and discarded main's duplicate forwarding code that didn't include format conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working engine::whispercpp whisper.cpp backend; audio transcription

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants