CineAI commited on
Commit
64b7c62
1 Parent(s): da424e0

Update audio_processing/T2A.py

Browse files
Files changed (1) hide show
  1. 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 = False) -> None:
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 not just_once:
20
  auto_play(audio)
21
- just_once = True
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)