From 531362f5e90020e42667f170c44294f095e6e7bd Mon Sep 17 00:00:00 2001 From: Josh Buker Date: Sat, 29 Jun 2024 21:36:55 +0000 Subject: [PATCH] Set defaults if ENV is blank This allows you to skip adding the environment variables if you plan on just using the usual default of English at normal playback speed. --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 8adde02..c390763 100644 --- a/app.py +++ b/app.py @@ -8,9 +8,9 @@ import tempfile load_dotenv() -DEFAULT_SPEED = float(os.getenv("DEFAULT_SPEED")) -DEFAULT_LANGUAGE = os.getenv("DEFAULT_LANGUAGE") -DEFAULT_SPEAKER_ID = os.getenv("DEFAULT_SPEAKER_ID") +DEFAULT_SPEED = float(os.getenv("DEFAULT_SPEED", 1.0)) +DEFAULT_LANGUAGE = os.getenv("DEFAULT_LANGUAGE", "EN") +DEFAULT_SPEAKER_ID = os.getenv("DEFAULT_SPEAKER_ID", "EN-Default") device = "auto" # Will automatically use GPU if available