Baghdad99 commited on
Commit
f47bfae
1 Parent(s): 73cf408

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -14,8 +14,10 @@ tts = pipeline("text-to-speech", model="Baghdad99/english_voice_tts")
14
 
15
  # Define the function to translate speech
16
  def translate_speech(audio_file):
 
 
17
  # Load the audio file with pydub
18
- audio = AudioSegment.from_mp3(audio_file.name)
19
 
20
  # Convert the audio to mono and get the raw data
21
  audio = audio.set_channels(1)
@@ -60,6 +62,7 @@ def translate_speech(audio_file):
60
 
61
  return 16000, synthesised_speech
62
 
 
63
  # Define the Gradio interface
64
  iface = gr.Interface(
65
  fn=translate_speech,
 
14
 
15
  # Define the function to translate speech
16
  def translate_speech(audio_file):
17
+ print(f"Type of audio: {type(audio_file)}, Value of audio: {audio_file}") # Debug line
18
+
19
  # Load the audio file with pydub
20
+ audio = AudioSegment.from_mp3(audio_file) # Change this line
21
 
22
  # Convert the audio to mono and get the raw data
23
  audio = audio.set_channels(1)
 
62
 
63
  return 16000, synthesised_speech
64
 
65
+
66
  # Define the Gradio interface
67
  iface = gr.Interface(
68
  fn=translate_speech,