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

"from gtts import gTTS" works fine in python 2.7 but it does not work in python 3.5. Why?

I want to execute this code: from gtts import gTTS tts = gTTS('hello', lang='en') tts.save('hello.mp3') In python (python 2.7.13) works fine but in python3 (python 3.5.3) is not working. It has always worked in the old python. Now, on a new PC (a…
Omar Cruz
  • 46
  • 1
  • 7
1
vote
1 answer

how to use gtts repeatedly?

when i call my function once i have no errors but if i call it repeatedly i will have the following error : Exception has occurred: PermissionError [Errno 13] Permission denied: 'tolkback.mp3' from gtts import gTTS import pyglet from playsound…
1
vote
2 answers

TypeError: 'module' object is not callable in Playsound module

Hello I have made a code: from gtts import gTTS import os import playsound from pip._vendor.distlib.compat import raw_input u = raw_input('type: ') def player(textg): tts = gTTS(text = textg, lang='en') tts.save('name.mp3') …
user10762774
0
votes
0 answers

Change Gender Voice from Python gtts library

I found this code to get Speech from text. Is there a way to change the gender of the voice? from gtts import gTTS tts = gTTS(text='Hello, how are you?', lang='en-IN') tts.save('hello2.mp3') print("finish") I found this parameters: Afrikaans…
0
votes
0 answers

How to fix audio file errors in python?

How to fix this error with code is: def speak(text): tts = gTTS(text=text, lang="vi") filename = 'voice.mp3' tts.save(filename) playsound.playsound(filename) os.remove(filename) Its error is: with open(str(savefile), "wb") as…
0
votes
0 answers

use of Django-gTTS to say multiple text in one audio

I am building a simple quiz app and I am using Django-gTTS to read out some text on my webpage but the problem that I am having is I cannot join regular text and text from my views in one audio tag. For example, I want my code to be something like…
0
votes
0 answers

I have problems with my bot TTS Discord.py

My intention is that when someone writes a message the bot reads it, and if there are many more messages, the bot waits for them to finish reading and then goes on to the next one and so on. @client.event async def on_message(msg): channel_mute…
galileo
  • 25
  • 5
0
votes
0 answers

PermissionError: [Errno 13] Permission denied: 'audio.mp3'

I am Getting an Error when Writing to an Audio File Basically, I am overwriting the data in the mp3 whenever my function gets called and then playing it. It works the first time through, but then it gives me PermissionError: [Errno 13] Permission…
0
votes
0 answers

gTTs silence segment

I'm trying to add silence inbetween to tts genarated voice, but cann't achieve this. the following code, merge the three tts but the silence couldn't be built: Code fragment: from gtts import gTTS tts_en = gTTS('hello', lang='en') tts_empty =…
mimo2202
  • 1
  • 1
0
votes
0 answers

My python .CSV to MP3 text-to-speech script is not passing text to the API correctly - how can I fix this?

So I've been working on a CSV to MP3 generator to create audio resources for learning French verbs. The script takes data from a csv spreadsheet and uses gTTS to generate french audio for the verbs, and english audio for the translations. This is…
0
votes
0 answers

How do I implement gTTs instead of pyttsx3 in my program?

I want to use gTTs instead of pyttsx3 as the tts engine in my program. Is it possible? Because pyttsx3 only has English language but I want to use my tts engine for filipino language, as a result, it is difficult for the tts engine to pronounce…
0
votes
0 answers

Why is gTTS making files with strange problems when saving?

I am using gTTS in Python and I am having the problem of it stuttering and repeating, as in the attached. glitchy text to speech I am calling it like: tts = gTTS(text) tts.save(path) as is normal. I have tried generating a different tts using…
colinryan
  • 1
  • 1
0
votes
0 answers

Gtts stutters after 2 sentences

I'm trying to make two gtts voices, Sarah and Mary, talk to each other reading a standard script. After 2 sentences of using the same voice, they start repeating the last word until the duration of the sentence is over. from moviepy.editor import…
0
votes
0 answers

How do you wiggle an image in moviepy when a certain voice is talking?

I want to wiggle an image when a certain voice is talking in a conversation. I am currently using gTTS to generate two speakers and for the audience to know who is talking, I want them to move around when each of them are talking. The two speakers…
Electro
  • 17
  • 8
0
votes
0 answers

Make a text-to-speech dialog in different voices in python gtts

I'm trying to make a conversation between two text-to-speech voices using gtts. I'm trying to make one be english sound french. I'm having trouble layering one voice to talk then another to talk right after it like an actual dialog. I was thinking…
Electro
  • 17
  • 8
1 2 3
8 9