Vishwas1 commited on
Commit
acd6515
·
verified ·
1 Parent(s): 5cc6df3

Upload app_minimal.py

Browse files
Files changed (1) hide show
  1. app_minimal.py +2 -1
app_minimal.py CHANGED
@@ -27,7 +27,8 @@ def generate_speech(text, voice):
27
  # Normalize audio
28
  audio = audio / np.max(np.abs(audio)) if np.max(np.abs(audio)) > 0 else audio
29
 
30
- return audio, f"✅ Successfully generated speech with voice: {voice}"
 
31
 
32
  except Exception as e:
33
  return None, f"❌ Error generating speech: {str(e)}"
 
27
  # Normalize audio
28
  audio = audio / np.max(np.abs(audio)) if np.max(np.abs(audio)) > 0 else audio
29
 
30
+ # Return in the format expected by Gradio Audio component: (sample_rate, audio_data)
31
+ return (24000, audio), f"✅ Successfully generated speech with voice: {voice}"
32
 
33
  except Exception as e:
34
  return None, f"❌ Error generating speech: {str(e)}"