dhanishetty commited on
Commit
c3e9db1
·
verified ·
1 Parent(s): d80a8a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -4,8 +4,8 @@ import azure.cognitiveservices.speech as speechsdk
4
  first_alert = "first.wav"
5
  next_alert = "next.wav"
6
 
7
- def Txt_To_Speech(SpeechRegion, SpeechKey, statements):
8
- if (SpeechRegion == '' or SpeechKey == '' or statements == ''):
9
  output= first_alert
10
  else:
11
  try:
@@ -16,8 +16,7 @@ def Txt_To_Speech(SpeechRegion, SpeechKey, statements):
16
 
17
  speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
18
 
19
- text = tuple(statements)
20
-
21
  with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as temp_file:
22
  temp_file.write(speech_synthesizer.speak_text_async(text).get())
23
 
 
4
  first_alert = "first.wav"
5
  next_alert = "next.wav"
6
 
7
+ def Txt_To_Speech(SpeechRegion, SpeechKey, text):
8
+ if (SpeechRegion == '' or SpeechKey == '' or text == ''):
9
  output= first_alert
10
  else:
11
  try:
 
16
 
17
  speech_synthesizer = speechsdk.SpeechSynthesizer(speech_config=speech_config, audio_config=audio_config)
18
 
19
+
 
20
  with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as temp_file:
21
  temp_file.write(speech_synthesizer.speak_text_async(text).get())
22