Update app.py
Browse files
app.py
CHANGED
|
@@ -45,9 +45,9 @@ async def speech_to_text(file: UploadFile = File(...)):
|
|
| 45 |
return {"text": decoded_message}
|
| 46 |
|
| 47 |
@app.post("/tts/")
|
| 48 |
-
def text_to_speech(input_text:
|
| 49 |
"""Convert text to a WAV audio file using ggwave and return as response."""
|
| 50 |
-
encoded_waveform = ggwave.encode(instance, input_text)
|
| 51 |
buffer = io.BytesIO()
|
| 52 |
wav.write(buffer, 44100, np.frombuffer(encoded_waveform, dtype=np.uint8))
|
| 53 |
buffer.seek(0)
|
|
|
|
| 45 |
return {"text": decoded_message}
|
| 46 |
|
| 47 |
@app.post("/tts/")
|
| 48 |
+
def text_to_speech(input_text: TextInput):
|
| 49 |
"""Convert text to a WAV audio file using ggwave and return as response."""
|
| 50 |
+
encoded_waveform = ggwave.encode(instance, input_text.text)
|
| 51 |
buffer = io.BytesIO()
|
| 52 |
wav.write(buffer, 44100, np.frombuffer(encoded_waveform, dtype=np.uint8))
|
| 53 |
buffer.seek(0)
|