Skip to content

Implements response_format to the /v1/audio/speech endpoint #2732

Description

@SuperPat45

The LocalAI /v1/audio/speech endpoint return a wav audio file.

OpenAI supports all these formats: mp3 (which is the default), opus, aac, flac, wav, and pcm.
To set the desired format, OpenAI has a response_format request parameter for /v1/audio/speech:
https://platform.openai.com/docs/api-reference/audio/createSpeech

mp3 and opus formats are smaller files and better for website than wav.
So, when ffmpeg is available, could LocalAI add supports for the response_format parameter to convert automatically, the generated wav audio file, to the desired format?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions