voicebox icon indicating copy to clipboard operation
voicebox copied to clipboard

Any chance to get .mp3 from the API?

Open mbaas2 opened this issue 4 months ago • 2 comments

It wouild be great if it /audio supported something like a format-parameter where one could pass the value "mp3" to get a that directly.

mbaas2 avatar Jul 09 '26 14:07 mbaas2

This is implemented in #1007.

GET /audio/{generation_id} and GET /audio/version/{version_id} now take ?format=, accepting wav, mp3, ogg, opus and flac:

curl "http://localhost:17493/audio/{generation_id}?format=mp3" -o clip.mp3

All five containers are written by the libsndfile already bundled with the app, so no ffmpeg is involved. Omit format and you get the stored file untouched, exactly as today — the transcode has to buffer a full encode, so it's only paid for when asked for, and a file already in the requested container is handed back as-is rather than round-tripped.

That PR is primarily the stories timeline; the encoder was built there for story export and this reuses it, which is why it's bundled in rather than standing alone.

Lvigentini avatar Aug 09 '26 14:08 Lvigentini

This landed on main in #1174 (prepared from #787, thanks @suifeng156) and will ship in Voicebox 0.7: GET /history/{id}/export-audio?format=mp3 returns the generation as MP3 (WAV stays the default). 0.6.0, the stability release, is cut and waiting only on an Apple notarization block. Closing as done; reopen if the endpoint shape does not work for your use.

capy-ai-staging avatar Oct 07 '26 04:10 capy-ai-staging