Update audio_processing/T2A.py
Browse files- audio_processing/T2A.py +3 -3
audio_processing/T2A.py
CHANGED
@@ -3,7 +3,7 @@ from streamlit_TTS import auto_play, text_to_audio
|
|
3 |
|
4 |
|
5 |
class T2A:
|
6 |
-
def autoplay(self, input_text: Optional[str] = None, lang: str = "en", just_once: bool =
|
7 |
"""
|
8 |
Plays audio once based on the provided input text.
|
9 |
|
@@ -16,9 +16,9 @@ class T2A:
|
|
16 |
if input_text is not None:
|
17 |
if isinstance(input_text, str):
|
18 |
audio = text_to_audio(input_text, language=lang)
|
19 |
-
if
|
20 |
auto_play(audio)
|
21 |
-
just_once =
|
22 |
else:
|
23 |
text = f"The text you provided is of data type {type(input_text)}, only string type is accepted"
|
24 |
audio = text_to_audio(text, language=lang)
|
|
|
3 |
|
4 |
|
5 |
class T2A:
|
6 |
+
def autoplay(self, input_text: Optional[str] = None, lang: str = "en", just_once: bool = True) -> None:
|
7 |
"""
|
8 |
Plays audio once based on the provided input text.
|
9 |
|
|
|
16 |
if input_text is not None:
|
17 |
if isinstance(input_text, str):
|
18 |
audio = text_to_audio(input_text, language=lang)
|
19 |
+
if just_once:
|
20 |
auto_play(audio)
|
21 |
+
just_once = False
|
22 |
else:
|
23 |
text = f"The text you provided is of data type {type(input_text)}, only string type is accepted"
|
24 |
audio = text_to_audio(text, language=lang)
|