Tonic commited on
Commit
5fd796b
1 Parent(s): babb2fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -38,8 +38,11 @@ def whisper_speech_demo(text, lang, speaker_audio, mix_lang, mix_text):
38
  audio_np = audio_data_resampled.cpu().numpy()
39
  audio_np = audio_np / np.max(np.abs(audio_np))
40
  audio_np = np.asarray(audio_np, dtype=np.float32)
 
 
 
41
  with tempfile.NamedTemporaryFile(suffix='.wav', delete=False) as tmp_file:
42
- sf.write(tmp_file.name, audio_np, 24000, format='WAV', subtype='PCM_16')
43
  return tmp_file.name
44
 
45
  with gr.Blocks() as demo:
 
38
  audio_np = audio_data_resampled.cpu().numpy()
39
  audio_np = audio_np / np.max(np.abs(audio_np))
40
  audio_np = np.asarray(audio_np, dtype=np.float32)
41
+
42
+ audio_stereo = np.stack((audio_np, audio_np), axis=-1)
43
+
44
  with tempfile.NamedTemporaryFile(suffix='.wav', delete=False) as tmp_file:
45
+ sf.write(tmp_file.name, audio_stereo, 24000, format='WAV', subtype='PCM_16')
46
  return tmp_file.name
47
 
48
  with gr.Blocks() as demo: