Questions tagged [gtts]

For questions about the Google Text-to-Speech (gTTS) Python library and CLI tool.

gTTS (Google Text-to-Speech) is a library and tool which interfaces with the Google Translate text-to-speech API.

References:

131 questions
1
vote
0 answers

gtts.tts.gTTSError: Failed to connect (host='translate.google.com', port=443 'Cannot connect to proxy.)

I am using Python (version 3.9) and GTTS (version 2.2.2) with the app.py file from gtts import gTTS tts = gTTS('hello', 'en') tts.save('hello.mp3') But When I run python app.py, the error happens. I got an error ProxyError(e, request=request) …
dacoten
  • 115
  • 2
  • 12
1
vote
1 answer

I made a voice assistant with Python. How can I execute only one when I use two different voice commands in the same sentence?

I am making a voice assistant with Python. I'm giving voice commands to the assistant. There are several predefined sentences and answers. However, if there are two commands defined in the code before, they start working at the same time. How can I…
1
vote
1 answer

"pygame.error: ModPlug_Load failed" When trying to play sound from bytes

I'm trying to make a simple Python script which should take a text as input and using gtts, play it as audio. I'm using the following code, but it's not working and I don't know why. from gtts import gTTS import pygame from io import…
mlazzarotto91
  • 103
  • 3
  • 13
1
vote
1 answer

No Response from gTTS program

I am trying to write a gTTS python program that converts text to speech and accepts commands that it is told, but when I run the code, I get no response at all, no errors in the terminal and no sound is played, I am not sure what to do and I am not…
ZiaCassim
  • 21
  • 1
1
vote
3 answers

How to fix gTTS Unable to find token python error

Im trying to create a virtual assistant but I cant get the gTTS working (google text to speech) working and I cant seem to fix it import os import time import playsound import speech_recognition as sr from gtts import gTTS def speak(text): tts…
1
vote
1 answer

python for android crashes at start: modul 'google_speech' and 'gtts' are missing

I wrote a python3 app called chinese_speaker with kivy and google_speech. after compiling with buildozer, I copied it to my smartphone. Every time I tried to start, it always closed immediately. so I activated adb debugging and in the logfiles I…
XnoT
  • 11
  • 2
1
vote
0 answers

How do I close internet tabs with python

Hello I am using gtts speech recognition and get audio to create a voice assistant like Alexa (this is why I named her Alex) and I am working on searching the web using the webbrowser module. Here it opens a website that says the weather in my…
crvcio
  • 321
  • 2
  • 5
  • 11
1
vote
0 answers

How do I get rid of error:jack server is not running or cannot be started

I am using gtts pyaudio and speechRecognition to create a siri-like chatbot on my raspberry pi. It is all working fine however it also produces this error Cannot connect to server socket err = No such file or directory Cannot connect to server…
crvcio
  • 321
  • 2
  • 5
  • 11
1
vote
2 answers

No response to voice commands by Virtual Assistant

I started making a virtual assistant program taking help from this YouTube video(https://www.youtube.com/watch?v=AGatX_8gaeM). I made the basic speech recognition code but it isn't responding to voice inputs to both internal microphone and external…
1
vote
1 answer

ValueError: mmap closed or invalid

I get the error ValueError: mmap closed or invalid Whenever i try and play audio. the code that seems to be the error is def speak(audioString): print(audioString) tts = gTTS(text=audioString, lang='en') tts.save("audio.mp3") with…
Enzo TDZ
  • 48
  • 6
1
vote
2 answers

Python gTTS several mp3 files issue

I am creating an app based on speech. Everything works fine but I do not want my app to use outside program to open mp3 file. At the moment program can do several commands only if I will use: cmd def speak(text): tts = gTTS(text=text, lang='pl') …
1
vote
1 answer

Python Convert text to mp3

Hi I am scraping data from a website and converting text to mp3 but every time it give me this error : Traceback (most recent call last): File "/home/awais/.local/lib/python2.7/site-packages/flask/app.py", line 2447, in wsgi_app response =…
Joy
  • 145
  • 2
  • 9
1
vote
1 answer

Python google speech recognition module doesn't work after a while

I'm trying to create an application like Alexa for the computer called "Emma" using Python. By using Speech Recognition module it'll use a microphone as a source to listen to the user. it works fine but after answering or doing some stuff like…
1
vote
1 answer

Audio issue with gTTS

I'm trying to code Jarvis. I'm having a problem with my audio output. when I run the python script, it said that I don't have OS imported. How would I solve this issue? -Many Thanks
Viet Huynh
  • 39
  • 2
1
vote
1 answer

How do you play sound directly in python?

I'm trying to find the best way to play a sound in Python without downloading any sound files (eg using temporary files with tempfile). This is for a speak function using gTTS; I've already come up with a solution to save the voice file to a…
apple_
  • 37
  • 1
  • 8
1 2
3
8 9