Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|
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:
|