unijoh commited on
Commit
3a1800f
1 Parent(s): 58fd969

Update tts.py

Browse files
Files changed (1) hide show
  1. tts.py +1 -1
tts.py CHANGED
@@ -33,7 +33,7 @@ def synthesize_speech(text):
33
  # Decode the generated speech and save to an audio file
34
  waveform = speech.cpu().numpy().flatten()
35
  # Use torchaudio to save the waveform
36
- file_path = "output.wav"
37
  torchaudio.save(file_path, torch.tensor(waveform).unsqueeze(0), 16000)
38
  logging.info(f"Audio file saved successfully at {file_path}.")
39
  return file_path
 
33
  # Decode the generated speech and save to an audio file
34
  waveform = speech.cpu().numpy().flatten()
35
  # Use torchaudio to save the waveform
36
+ file_path = "/tmp/output.wav" # Use a temporary directory
37
  torchaudio.save(file_path, torch.tensor(waveform).unsqueeze(0), 16000)
38
  logging.info(f"Audio file saved successfully at {file_path}.")
39
  return file_path