mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-04-22 23:57:17 +08:00
```
docs: update media examples and add parameter details for TTS providers - Updated EdgeTTS example to mention additional audio parameters (`rate`, `volume`, `pitch`) - Updated gTTS example to include support for `tld` and `slow` audio parameters - Modified the EdgeTTS provider to use `get_last_message` instead of `format_image_prompt` for prompt handling - Modified the gTTS provider to use `get_last_message` instead of `format_image_prompt` for prompt handling - Refactored audio file generation logic in the gTTS provider to handle `language` parameter and update the voice model accordingly - Refactored backend API code to introduce `cast_str` function for processing responses, including cache management and response formatting - Fixed a bug in `AnyProvider` where the model string check would fail if the model was `None` - Added check in `to_string` helper function to handle `None` values correctly ```
This commit is contained in:
+5
-1
@@ -51,9 +51,13 @@ client = Client(provider=EdgeTTS)
|
||||
response = client.media.generate("Hello", audio={"language": "en"})
|
||||
response.data[0].save("edge-tts.mp3")
|
||||
|
||||
# The EdgeTTS provider also support the audio parameters `rate`, `volume` and `pitch`
|
||||
|
||||
client = Client(provider=gTTS)
|
||||
response = client.media.generate("Hello", audio={"language": "en"})
|
||||
response = client.media.generate("Hello", audio={"language": "en-US"})
|
||||
response.data[0].save("google-tts.mp3")
|
||||
|
||||
# The gTTS provider also support the audio parameters `tld` and `slow`
|
||||
```
|
||||
|
||||
#### **Transcribe an Audio File:**
|
||||
|
||||
Reference in New Issue
Block a user