mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2024-11-07 16:44:13 +01:00
5e2b3407ef
* Update elevenlabs example to use ufficial python API * Update elevenlabs example to use official python API
21 lines
510 B
Python
21 lines
510 B
Python
import sys
|
|
import importlib.util
|
|
|
|
if importlib.util.find_spec("elevenlabs") is None:
|
|
print("elevenlabs library is not installed, you can install it to your enviroment using 'pip install elevenlabs'")
|
|
sys.exit()
|
|
|
|
from elevenlabs import generate, play, save
|
|
|
|
# Get a Voice object, by name or UUID
|
|
voice = "Arnold" #Possible Voices: Adam Antoni Arnold Bella Domi Elli Josh
|
|
|
|
# Generate the TTS
|
|
audio = generate(
|
|
text=str(sys.argv[2:]),
|
|
voice=voice
|
|
)
|
|
|
|
# Save the TTS to a file
|
|
save(audio, "audio.mp3")
|