forked from ggerganov/whisper.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
talk, talk-llama : add basic example script for eleven-labs tts (gger…
- Loading branch information
Showing
6 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
eleven-labs.py | ||
audio.mp3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
import importlib.util | ||
|
||
api_key = "" #Write your https://beta.elevenlabs.io api key here | ||
if not api_key: | ||
print("To use elevenlabs you have to register to https://beta.elevenlabs.io and add your elevenlabs api key to examples/talk-llama/eleven-labs.py") | ||
sys.exit() | ||
|
||
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 ElevenLabs | ||
eleven = ElevenLabs(api_key) | ||
|
||
# Get a Voice object, by name or UUID | ||
voice = eleven.voices["Arnold"] #Possible Voices: Adam Antoni Arnold Bella Domi Elli Josh | ||
|
||
# Generate the TTS | ||
audio = voice.generate(str(sys.argv[2:])) | ||
|
||
# Save the TTS to a file | ||
audio.save("audio") |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
eleven-labs.py | ||
audio.mp3 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
import importlib.util | ||
|
||
api_key = "" #Write your https://beta.elevenlabs.io api key here | ||
if not api_key: | ||
print("To use elevenlabs you have to register to https://beta.elevenlabs.io and add your elevenlabs api key to examples/talk/eleven-labs.py") | ||
sys.exit() | ||
|
||
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 ElevenLabs | ||
eleven = ElevenLabs(api_key) | ||
|
||
# Get a Voice object, by name or UUID | ||
voice = eleven.voices["Arnold"] #Possible Voices: Adam Antoni Arnold Bella Domi Elli Josh | ||
|
||
# Generate the TTS | ||
audio = voice.generate(str(sys.argv[2:])) | ||
|
||
# Save the TTS to a file | ||
audio.save("audio") |
This file contains 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