Is it possible to make a text to speech program that outputs the speech through my mic? So I can use it over Discord/TeamSpeak/Game voice chat/ect
I would assume yes but can someone very briefly point me in the right direction?
Which modules should I use?
Which functions?
(Apr-04-2019, 02:07 AM)Larz60+ Wrote: [ -> ]There are already packages that do this.
One of the more popular is gTTs: https://github.com/pndurette/gTTS
documentation here: https://gtts.readthedocs.io/en/latest/
The short side of this package is that it relies on Google and therefore needs an internet connection to run.
This can be installed with:
pip install gTTS
An alternative, that does not rely on Google is pyttsx3
homepage: https://github.com/nateshmbhat/pyttsx3
documentation here: https://pyttsx3.readthedocs.io/en/latest/
This can be installed with:
pip install pyttsx3
Tysm, how do I get either one to work through my mic though? I don't want to just hear the text to speech myself, I want it to output to my recording device on my computer so that I can use it on voice communication stuff. Like TeamSpeak/Discord/ect
Is that possible? If so, how? Which function on either of those do I use? I can't find anything to do that.
This is the code I have so far:
How can I make this .mp3 play through my mic? (so that people on Discord/TeamSpeak/Voice Chat can hear it)
from gtts import gTTS
t2s = gTTS(text="Hello this is the text to play", lang='en')
t2s.save("voice1.mp3")
I assume I would need a virtual audio cable to do this? I have VB Audio Cable installed. I don't know how to output the .mp3 into the recording device though. How do I do that in Python?
Do not start new threads on a subject already started, it's against forum rules.
Merged with old thread
Sorry. Thought it would be easier to set this one to solved and ask the other question in a separate clear thread so that all these replies don't confuse people.
All I need to do is change the output device that Python plays the sound in. I have a VB audio cable. How do I change the output audio device that python plays to?
Quote:Sorry. Thought it would be easier to set this one to solved and ask the other question in a separate clear thread
Not a problem, we are here to answer questions, a never ending process.
Which package did you choose to use?
Is the output an mp3 file?
(Apr-04-2019, 07:41 PM)Larz60+ Wrote: [ -> ]Quote:Sorry. Thought it would be easier to set this one to solved and ask the other question in a separate clear thread
Not a problem, we are here to answer questions, a never ending process.
Which package did you choose to use?
Is the output an mp3 file?
gTTs
Yes it's a .mp3 file
All I need to do is change the output device of the sound that the python script plays. I'm using VB audio cable. So all I need to do is change the output of the sound to this:
![[Image: AX2YZWH.png]](https://i.imgur.com/AX2YZWH.png)