feat: encode audio as 64 kbps MP3 instead of WAV

Convert the normalized audio to mono 16 kHz MP3 at 64 kbps with
FFmpeg's libmp3lame encoder instead of uncompressed WAV. This reduces
request payload size before base64 encoding and submitting to OpenRouter.
Update README documentation accordingly.
This commit is contained in:
2026-09-05 15:16:56 +02:00
parent e6b36c2b48
commit a2c8502c61
2 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ export OPENROUTER_API_KEY='sk-or-v1-...'
```
Accepts m4a, mp4, aac, flac, opus, mp3, ogg, wav, and other formats your
FFmpeg supports. Uses the first audio track, converts it to mono 16 kHz WAV,
FFmpeg supports. Uses the first audio track, converts it to mono 16 kHz MP3
at 64 kbps (requires FFmpeg's libmp3lame encoder),
and sends it to OpenRouter's `microsoft/mai-transcribe-2` model. Temporary
files are removed on exit. The transcript goes to stdout; errors to stderr.