unijoh commited on
Commit
7bbbabd
1 Parent(s): 6f615ad

Update tts.py

Browse files
Files changed (1) hide show
  1. tts.py +2 -1
tts.py CHANGED
@@ -30,7 +30,8 @@ def synthesize_speech(text):
30
  logging.info("Speech generated successfully.")
31
 
32
  # Decode the generated speech and save to an audio file
33
- waveform = speech.cpu().numpy()
 
34
  sf.write("output.wav", waveform, 16000)
35
  return "output.wav"
36
  except Exception as e:
 
30
  logging.info("Speech generated successfully.")
31
 
32
  # Decode the generated speech and save to an audio file
33
+ waveform = speech.cpu().numpy().flatten()
34
+ # Convert waveform to audio format that Gradio can handle
35
  sf.write("output.wav", waveform, 16000)
36
  return "output.wav"
37
  except Exception as e: