Skip to content
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

Open
s-b-repo opened this issue Mar 13, 2023 · 6 comments
Open

tts for the chat bot #13

s-b-repo opened this issue Mar 13, 2023 · 6 comments

Comments

@s-b-repo
Copy link
Contributor

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.

@RaSan147
Copy link
Owner

Optimization idea: store common audios in storage. Not planning to generate TTS on running computer, instead on api basis. Checking your code. Thanks

@RaSan147
Copy link
Owner

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 .

@s-b-repo
Copy link
Contributor Author

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

@s-b-repo
Copy link
Contributor Author

s-b-repo commented Mar 13, 2023

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 .

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

@RaSan147
Copy link
Owner

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

@RaSan147 RaSan147 changed the title tts for the ai using tortuse tts github project tts for the chat bot Apr 15, 2023
@RaSan147
Copy link
Owner

RaSan147 commented Sep 4, 2023

Currently using edge-tts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants