rany2 / edge-tts

Use Microsoft Edge's online text-to-speech service from Python WITHOUT needing Microsoft Edge or Windows or an API key
https://pypi.org/project/edge-tts/
GNU General Public License v3.0
6.23k stars 616 forks source link

Suggestion or question #181

Closed Keiser04 closed 9 months ago

Keiser04 commented 9 months ago

I was wondering if it would be possible to receive the audio as wav instead of mp3?

rany2 commented 9 months ago

You can try to change the outputFormat here https://github.com/rany2/edge-tts/blob/5b7add93b9f64c27b5ed7138c30a1a4f25ba6a9d/src/edge_tts/communicate.py#L364

The list of possible values are available here: https://github.com/microsoft/cognitive-services-speech-sdk-js/blob/master/src/sdk/Audio/AudioOutputFormat.ts#L16-L52

But in my testing they seem to be filtering the outputFormat to only support those that Edge uses, which is what is currently set.