fix(generators/ideas.py): fix typo in variable name 'existing_ideas'

feat(generators/montage.py): add check to skip slide if it already exists
feat(generators/montage.py): add support for DEEPL_ACCESS_KEY and UNSPLASH_ACCESS_KEY environment variables
feat(generators/speak.py): add support for Johanne voice
feat(generators/speak.py): add emotion parameter to generate_voice function
feat(generators/uploader.py): add success message and authorization prompt message to run_local_server method
fix(main.py): check if credits is None before writing to meta.txt file
feat(prompts/marp.md): change theme to gaia and add lead and invert classes
This commit is contained in:
Paillat
2023-05-25 21:47:11 +02:00
parent 32c14a01ca
commit 25f578f48c
6 changed files with 90 additions and 58 deletions

View File

@@ -8,17 +8,23 @@ fakenames = {
"Alexander": "p230",
"Benjamin": "p240",
"Amelia": "p270",
"Katherine": "p273"
"Katherine": "p273",
"Johanne": "p347",
}
voices = ["Alexander", "Benjamin", "Amelia", "Katherine"]
voices = ["Alexander", "Benjamin", "Amelia", "Katherine", "Johanne"]
# Init TTS
def generate_voice(path, text, speaker="Alexander"):
try:
tts = TTS(model_best_multi, gpu=True)
except:
tts = TTS(model_best_multi, gpu=False)
model = model_best_multi
speaker = fakenames[speaker] if speaker in fakenames else speaker
tts.tts_to_file(text=text, file_path=path, speaker=speaker, speed=1)
print(f"Generating voice for {model} with speaker {speaker}")
try:
tts = TTS(model, gpu=True)
except:
tts = TTS(model, gpu=False)
tts.tts_to_file(text=text, file_path=path, speaker=speaker, speed=1, emotion="Happy")
if __name__ == "__main__":
generate_voice("test/test.mp3", "This is a test. I like the words python, django and flask. Betty bought a bit of butter but the butter was bitter. So she bought some better butter to make the bitter butter better.")