Coder Social home page Coder Social logo

gikonyob / speake3 Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 7 KB

Speake3 library provides a wrapper around Espeak to easily write efficient programs utilizing the text-to-speech functionalities of espeak tts engine in Python.

License: MIT License

Python 100.00%
text-to-speech tts espeak python python3 tts-engines python-library

speake3's Introduction

Speake3

Speake3 library provides a wrapper around Espeak to easily write efficient programs utilizing the text-to-speech functionalities of espeak tts engine in Python.

Installation

Requirements

 - Linux system
 - Espeak
 - python3.x

Install commands

If pip is installed simply do;

 pip3 install speake3

Quick start

A simple script using speake module;

>>> import speake3
>>> 
>>> engine = speake3.Speake() # Initialize the speake engine
>>> engine.set('voice', 'en')
>>> engine.set('speed', '107')
>>> engine.set('pitch', '99')
>>> engine.say("Hello world!") #String to be spoken
>>> engine.talkback()

You can view the version of espeak installed;

 >>> version = engine.get("version")
 >>> print(version)

You can view voices installed in your system both generally and specifially;

 >>> voices = engine.get("voices") # General
 >>> for voice in voices:
 >>>	print(voice) 
 >>> voices_2 = engine.get("voices", "en") # Specific
 >>> for voice in voices_2:
 >>>	print(voice)

You can set properties using set method;

 >>> engine.set("voice", "en") # voice attribute can be any VoiceName value or 
 >>>			   #File value gotten from the voices dictionaries

Possible attributes that can be set are:textfile, stdin, amplitude, wordgap, capitals, line-length, pitch, speed, voice, wavfile, stdout, version, voices, text-encoding, markup, quiet, punct, split, write-pm, nopause

Properties that have been set can also be unset;

 >>> engine.unset("speed")
 >>> engine.unset("pitch")

If you make multiple calls on say before calling the talkback method all the string parameters in the say methods will be spoken one after the other since they are put in an internal queue.

 >>> engine.say("Hello World")
 >>> engine.say("Foo bar")
 >>> engine.say("Monty Python")
 >>> engine.talkback()

speake3's People

Contributors

eskilop avatar gikonyob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

eskilop

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.