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
0
votes
4 answers

GTTS module error, ImportError: cannot import name gTTS

I am trying to make a Voice assistant in python using this code import os from gtts import gTTs import time import playsound import speech_recognition as sr def speak(text): tts = gTTS(text=text, lang="en") filename = "voice.mp3" …
qwertyboy2020
  • 11
  • 1
  • 2
0
votes
1 answer

How to maintain punctuation while doing Text to speech?

I have a table which contains HTML content to show it on Web Page. I am trying to convert that content into text to speech after extracting plain text from it. But When I hear that converted content, there is no pause in it and voice is very…
adnan
  • 504
  • 1
  • 4
  • 21
0
votes
1 answer

Recording audio from microphone in Python

I'm trying to create a virtual assistant in python, which works using speech recognition. While running the program though, it isn't taking any voice input, though there are no errors. My microphone is properly connected and I'm pretty sure there is…
0
votes
1 answer

How to use Google Text to Speech (python) in Ubuntu 20.04?

Here is the screenshot of the errors which I am getting. Please help me! I have also installed mpg321 in my Ubuntu 20.04. It is working fine if I play music from terminal. Here, I am playing a song from terminal. I've tried to play hello.mp3…
0
votes
1 answer

Make delay of answer shorter

I am making voice assistant on python. Here is the code: import os import time import playsound import speech_recognition as sr from gtts import gTTS def speak(text): tts = gTTS(text=text, lang="en") filename = "voice.mp3" …
user13801689
0
votes
2 answers

how to read string in sound with python without create mp3 file just with command line

I want to make python read string which added in a variable from before because I am creating scraping script and if there are any errors, I want it to tell me, I watched many of video about that but all were about read the text and then creating…
0
votes
1 answer

How to make Python speak

I have seen a lot of examples in here but I haven't got what I wanted. All of the examples which I have seen make Python speak only what is typed. Ex. speaker.speak('What is your name?') But instead of making python speak whatever is typed, I want…
0
votes
2 answers

ModuleNotFoundError: No module named '__main__.gtts'; '__main__' is not a package

I am trying to convert a text to speech in python using gtts I am using the 3.7.4 version of python but whenever I use gtts ModuleNotFoundError: No module named 'main.gtts'; 'main' is not a package or the sometimes it says gtts module cannot be…
0
votes
1 answer

How to save Powershell's output to file when I create synthetic voice audio with Text-to-Speech using the command line

please teach me how to make Powershell automatically save its tts output to TEXT file, as I'm getting just a long string like this: { "audioContent": "//NExAAQ4oIMABhEuDRESizqE7uehfMY8A........... I have to process more than 1400 files :( what to…
0
votes
1 answer

__enter__ error using google's speech api python3

I am making a speech recognizer project in python using google's API. The code is below: from gtts import gTTS import speech_recognition as sr def get_audio(): r = sr.Recognizer() with sr.Microphone as source: l =…
0
votes
1 answer

I tried to run a simple gTTS speech message but while the mp3 file is being made, i cant hear anything when i try to run it

I am using Sublime Text 3 and Python 3.7.6. Here is the code I'm using; from gtts import gTTS tts = gTTS(text="Hello crazy programmer", lang='en') tts.save("audio.mp3")
0
votes
1 answer

How to make the computer speak in python?

I tried to use gtts: from gtts import gTTs import os tts = gTTS(text='Good morning', lang='en') tts.save("good.mp3") os.system("mpg321 good.mp3") But I got this error: 'mpg321' is not recognized as an internal or external command operable program…
GjdGr8
  • 133
  • 1
  • 1
  • 7
0
votes
0 answers

Getting an error when trying to create an except sr.UnknownValueError:

this is the part of the script that is messing it all up def MyCommand(): #init recongnize voice r = sr.Recongnize() r.pause_thershold = 3 #threshold = one second, waiting to adjust threshold dependent on noise levels …
0
votes
1 answer

cannot import gTTS from gtts:IMPORT ERROR

So this speech to text code in python is having problem in import gTTs when it is imported gtts only then its fine but the problem persists with gTTS. The code is as belows. from gtts import gTTs import os text_to_read = "Read any text written…
0
votes
1 answer

how do you make a parameter of a function into a string

I am making a chatbot and I am trying to create a function that gets a question and responds in a certain way but I receive an error that says TypeError: argument of type 'function' is not iterable regarding the if statement in the "def quanda"…
1 2 3
8
9