Giter VIP home page Giter VIP logo

text-to-speech's Introduction

Text-to-speech

TTS

License: MIT

A simple text-to-speech program using:

  • Python3 GUI (tkinter);
  • Google Text-to-Speech Python lib(gTTS);

Setup

Installing

Install Google Text-to-Speech lib

user@linux:~$ pip install gTTS

Imports

Google Text-to-Speech

from gtts import gTTS

To use operating system funcionalities, import Python OS module

import os

Tkinter Python GUI

from tkinter import *

To show errors, attention and other alert messages

from tkinter import messagebox

For Mac OS users, some buttons and icons does not work properly. Please, use ttk submodule.

from tkinter import ttk

Let's Speak

Before running the program, you need to choose the correct player based on your operating system.

(afplay is a Mac OS command.)

Choosing the player

  • For Arch Linux based (Manjaro...)
user@linux:~$ sudo pacman -S mpg123
  • For Debian Linux based (Ubuntu...)
user@linux:~$ sudo apt-get update
user@linux:~$ sudo apt-get install mpg123
  • For Redhat Linux based (Fedora, SUSE...)
user@linux:~$ yum install mpg123

After successful installation, you can test it.

user@linux:~$ mpg123 <some_audio_file>.mp3

NOTE

It's necessary to change afplay to correct mp3 player at /source/TextToSpeech.py

#The argument & indicates afplay to run in the background as a job.
os.system("afplay sound/output.mp3 &")

License

This project is licensed under the MIT License.

Author

Gustavo Dias A.

text-to-speech's People

Contributors

gfda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.