mgokg commited on
Commit
09a8f83
·
verified ·
1 Parent(s): fb6e994

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -66,14 +66,15 @@ def transcribe_audio(audio):
66
  result = result[0][1]
67
  result=gr.Markdown(result)
68
  #return result
 
69
  # ... (rest of the code to get the result)
70
  result_text = result # assuming result is the text response
71
  # Generate a unique file name with timestamp
72
  timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
73
- output_file = os.path.join('tmp', f'output_{timestamp}.mp3')
74
  # Ensure the tmp directory exists
75
- if not os.path.exists('tmp'):
76
- os.makedirs('tmp')
77
  # Convert text to speech
78
  tts = gTTS(text=result_text, lang='de', slow=False)
79
  tts.save(output_file)
 
66
  result = result[0][1]
67
  result=gr.Markdown(result)
68
  #return result
69
+ print(result)
70
  # ... (rest of the code to get the result)
71
  result_text = result # assuming result is the text response
72
  # Generate a unique file name with timestamp
73
  timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
74
+ output_file = os.path.join('tmp/gradio', f'output_{timestamp}.mp3')
75
  # Ensure the tmp directory exists
76
+ if not os.path.exists('tmp/gradio'):
77
+ os.makedirs('tmp/gradio')
78
  # Convert text to speech
79
  tts = gTTS(text=result_text, lang='de', slow=False)
80
  tts.save(output_file)