Fixing legacy VOICE variables

Fixing legacy VOICE variables that caused lot of issues if TTSCHOICE set to AWS_VOICE or STREAMLABS_VOICE
This commit is contained in:
Muhammed Mustafa Akşam committed 2022-07-04 11:06:26 +03:00
1 parent 6412aa546b
commit ada9b69299
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -35,9 +35,9 @@ class AWSPolly:
if random_voice:
voice = self.randomvoice()
else:
if not os.getenv("VOICE"):
if not os.getenv("AWS_VOICE"):
return ValueError(
f"Please set the environment variable VOICE to a valid voice. options are: {voices}"
f"Please set the environment variable AWS_VOICE to a valid voice. options are: {voices}"
)
voice = str(os.getenv("AWS_VOICE")).capitalize()
try:
+2 -2
View File
@@ -35,9 +35,9 @@ class StreamlabsPolly:
if random_voice:
voice = self.randomvoice()
else:
if not os.getenv("VOICE"):
if not os.getenv("STREAMLABS_VOICE"):
return ValueError(
f"Please set the environment variable VOICE to a valid voice. options are: {voices}"
f"Please set the environment variable STREAMLABS_VOICE to a valid voice. options are: {voices}"
)
voice = str(os.getenv("STREAMLABS_VOICE")).capitalize()
body = {"voice": voice, "text": text, "service": "polly"}