Last active
March 18, 2025 10:37
-
-
Save jondurbin/9f84bcd0be8f7b1be032bb1fff88dc83 to your computer and use it in GitHub Desktop.
Inference example with Spark-TTS on chutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import base64 | |
audio = base64.b64encode(open("test.wav", "rb").read()).decode() | |
result = requests.post( | |
"https://chutes-spark-tts.chutes.ai/speak", | |
json={ | |
"text": "How much wood would a woodchuck chuck if a woodchuck could chuck wood?", | |
"sample_audio_b64": audio, | |
"speed": "very_low", | |
"pitch": "very_high", | |
}, | |
headers={ | |
"Authorization": os.environ["CHUTES_API_KEY"], | |
}, | |
) | |
with open("new.wav", "wb") as outfile: | |
outfile.write(result.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment