Text to Speech by using ttsvoice - Python Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report TTSVoice transforms written text into spoken language. TTSVoice Python library analyses text using natural language processing algorithms to produce synthetic speech that mimics human speech. Applications for this technology range from language translators to digital assistants like Siri and Alexa, to assistive solutions for those with visual impairments. Required Modules: pip install ttsvoiceConvert Text-to-Speech in Python using ttsvoice The voice Python packages provide the tts() function to implement text-to-speech functionality. Note: Run the codes in the Visual Studio IDE. Syntax: tts(text,voice,tempo) Parameters of tts() function: text: Pass any python string or python string variable as the first argument. The text parameter is mandatory.voice: Pass "male" or "female" to change the pitch of the voice according to gender. It is an optional parameter. The default parameter is "female".tempo: Pass "high", "normal" or "low" to change the rate of words per 1 second. It is an optional parameter. The default parameter is "normal". Example 1: Python3 from ttsvoice import tts tts("Hello from GFG") Output : This code will turn the text "Hello from GFG" into speech. By default, if we are not giving any parameters, then the voice will be female and the tempo would be normal. Example 2: Python3 from ttsvoice import tts tts("Hi from GFG","male" ) Output : This code will turn the text "Hi from GFG" into speech. Here we are giving the voice should be Male, and the tempo is normal by default. Example 3: Python3 from ttsvoice import tts tts("Hi from GFG","male","low") Output : This code will turn the text "Hi from GFG" into speech. Here we are giving the voice should be Male, and the tempo is low,so you will listen the text very slowly. Example 4: Python3 from ttsvoice import tts tts("Hi from GFG","male","high") Output: This code will turn the text "Hi from GFG" into speech. Here we are giving the voice should be Male, and the tempo is High, so you will listen to the text very fast. Example 5: You have to create a temp.txt file and you can write your text in it. With the help of ttsvoice we can read every line of a text file. Python3 from ttsvoice import tts file1 = open("temp.txt","r") aa=file1.readlines() for a in aa: tts(a,"male") Output: The output we data from the text file. Here we are giving the voice should be Male, and the tempo is Normal. Comment More infoAdvertise with us Next Article Text to Speech by using ttsvoice - Python mihirpanchal5400 Follow Improve Article Tags : Python Python-Library Practice Tags : python Similar Reads Text to Speech by using pyttsx3 - Python Converting text to speech can add a new level of interactivity to our Python applications. Whether we want to create a virtual assistant or simply make our program more engaging, pyttsx3 is a library used for converting text into speech. This offline tool offers flexibility with male and female voic 3 min read Text to speech GUI convertor using Tkinter in Python Prerequisite: Introduction to Tkinter Tkinter is the standard GUI library for Python. Python when combined with tkinter provides a fast and easy way to create GUI applications.By this library we can make a compelling choice for building GUI applications in Python, especially for applications where a 3 min read Convert PDF File Text to Audio Speech using Python Let us see how to read a PDF that is converting a textual PDF file into audio.Packages Used:pyttsx3: It is a Python library for Text to Speech. It has many functions which will help the machine to communicate with us. It will help the machine to speak to usPyPDF2: It will help to the text from the P 2 min read Convert Text to Speech in Python There are several APIs available to convert text to speech in Python. One of such APIs is the Google Text to Speech API commonly known as the gTTS API. gTTS is a very easy to use tool which converts the text entered, into audio which can be saved as a mp3 file. The gTTS API supports several language 4 min read Send message to Telegram user using Python Have you ever wondered how people do automation on Telegram? You may know that Telegram has a big user base and so it is one of the preferred social media to read people. What good thing about Telegram is that it provides a bunch of API's methods, unlike Whatsapp which restricts such things. So in t 3 min read Typing Speed Test Project Using Python Streamlit Library Typing Speed Test Project involves typing content with the input field displayed on the screen where we need to type the same content also a timer of 30 seconds runs continuously, and when it reaches zero, our typing speed is displayed on the screen in words per minute (WPM). This article will guide 2 min read Convert Text to Speech in Python using win32com.client There are several APIs available to convert text to speech in python. One of such APIs available in the python library commonly known as win32com library. It provides a bunch of methods to get excited about and one of them is the Dispatch method of the library. Dispatch method when passed with the a 2 min read Python Text To Speech | pyttsx module pyttsx is a cross-platform text to speech library which is platform independent. The major advantage of using this library for text-to-speech conversion is that it works offline. However, pyttsx supports only Python 2.x. Hence, we will see pyttsx3 which is modified to work on both Python 2.x and Pyt 2 min read Extract speech text from video in Python Nowadays, videos have become an integral part of our lives. Videos educate us and provide the necessary information. In this article, we will learn how to extract text speech from video using Python. Extract Speech Text from the Video To extract speech text from video in Python, we require the follo 3 min read Speech To Text using IBM Watson Studio IBM Watson Studio is an integrated environment designed to develop, train, manage models, and deploy AI-powered applications and is a Software as a Service (SaaS) solution delivered on the IBM Cloud. The IBM Cloud provides lots of services like Speech To Text, Text To Speech, Visual Recognition, Nat 2 min read Like