-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tts for the chat bot #13
Comments
Optimization idea: store common audios in storage. Not planning to generate TTS on running computer, instead on api basis. Checking your code. Thanks |
Output looks great. But needs a gpu and probably won't run on potato pc and definitely not small cloud hostings...scared ti use this one. Keeping it as a good option . |
my brother uses aws its afordable for small use cases the charge on terabytes space and heavy usage or you can try linode |
and you can always save it to a data base where it save multiable responses to the same question like 20 each like saving the replys and play them |
The issue is it doesn't generate same output, instead genetes random msg on every query, so caching might help but not always. generating every tts locally , i can smell my gou burnibg |
Currently using edge-tts |
you'll need to create an endpoint in your website's backend that takes in text input and outputs the synthesized audio. You can use the Tortoise-TTS library in your backend code to generate the audio. Here's a sample code snippet in Python:
python
from tortoiseTTS import Tortoise
def generate_audio(text):
tortoise = Tortoise()
audio = tortoise.say(text)
return audio
You can expose this function as an API endpoint using a Python web framework like Flask or Django. For example, with Flask:
python
from flask import Flask, request
app = Flask(name)
@app.route('/api/synthesize', methods=['POST'])
def synthesize():
text = request.form.get('text')
audio = generate_audio(text)
return audio
if name == 'main':
app.run()
Note that this is just a basic example, and you may need to modify it depending on your specific use case. Also, be aware that generating audio can be a computationally intensive task, so you may want to optimize the code for performance if you expect a high volume of requests.
The text was updated successfully, but these errors were encountered: