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
1 answer

Python3 program on raspberry pi doesn't play sound, even though audio works otherwise

I am trying to play a sound with the playsound module on Python 3 with my raspberry pi 3 model B+. I use gTTS to save a tts file and use the playsound module to play the sound. But, for some reason the code completes with no errors and the audio…
0
votes
1 answer

use gTTS to speak rather than saving as mp3?

I am trying to create a voice assistant using, gtts(Google text to speech). I tried doing this but for audio output, it was able to write something that first saves the file and then plays it using audio player (in ubuntu), how to make it in the…
0
votes
0 answers

change language in gTTS using subprocess

import os import subprocess from gtts import gTTS class Record: def __init__(self, file, path): self.file_name = f'{file.split(".")[0]}.mp3' self.file_path = os.path.join(path, file) self.out_path = os.path.join(path,…
hwhat
  • 326
  • 1
  • 5
  • 14
0
votes
1 answer

How to use gTTS (google text to speech) in visual studio code?

I want to use the google text to speech(gTTS) in my visual studio code project. I need help with: a) downloading it b)using it in VS Code c) running it in VS Code I've been really confused on trying to use this module and other modules in VS…
OscarF123
  • 31
  • 2
  • 8
0
votes
1 answer

Google text- to-Speech gTTs not working as expected

I installed gtts using "pip3 install gTTs", but I am getting this error whenever I run the program. from gtts import gTTs. ImportError: cannot import name 'gTTs' This is the part of the code which is generating the error.I am using speak() as a…
raviTeja
  • 338
  • 1
  • 7
  • 21
0
votes
1 answer

Django save override never stops saving gtts generated mp3 file to directory

When I run the save override method, the mp3 file is saved to the specified folder, only it keeps saving itself to that dir over and over again until I eventually restart the server. The file is saved to the right place and it can be played with…
Puto Miké
  • 73
  • 1
  • 8
-1
votes
1 answer

I want to develop a talk program using python

and iam looking for libraries that supports Arabic-SA (Saudi Arabia) language any suggestions?
-1
votes
1 answer

Using Flask to reproduce an audio using json

i'm trying to make an app in flask-python that using a json post send an audio using the gtts google library as the answer, but my method doesn't work. My code is the following. from gtts import gTTS from flask import Flask, send_file,…
0xTochi
  • 13
  • 5
-2
votes
0 answers

Python Functions execute in wrong order, can someone help me?

FYI i just started learning Python. I intended to take partial screenshot, show the screenshot image, then read it with OCR, then gTTS will play the sound on how to read it. But instead, when i run the program, it will show the previous screenshot…
-2
votes
1 answer

When running gtts code, some lines (written before gtts code ) run after audio is played. I want some lines of code to run before audio is played

def play(audio): sound = gTTS(audio) sound.save('sound.mp3') playsound('sound.mp3') def isCorrect(self, n): # checking whether option clicked is correct or not and updating info if n == self.anspos: self.score = self.score…
-5
votes
2 answers

No voice after running?

The output of the code below should be a voice saying, 'Welcome to geeks for geeks!', but I'm getting 1, why? from gtts import gTTS import os mytext = 'Welcome to geeksforgeeks!' language = 'en' myobj = gTTS(text=mytext, lang=language,…
1 2 3
8
9