Git Product home page Git Product logo

tts's Introduction

tts - A lightweight python TTS wrapper

tts is a python wrapper around Text To Speech api's

Currently only supports SAPI

Setup

To install, simply use pip and point it at the repository

pip install git+https://github.com/DeepHorizons/tts

To Use

Import the tts package with the api you wish to use

SAPI

import tts.sapi
voice = tts.sapi.Sapi()
voice.say("Hello")
voice.set_voice("Anna")

voice.create_recording('output.wav', "This will be in a wav file")

voice.set_rate(-5)
voice.say("This will be said slower")

voice.set_volume(30)
voice.say("This will be said on a lower volume")

Aside from text, it also support SSML. You'll need to pass the SpeechVoiceSpeakFlags.IsXML flag as a second parameter for the say() function

import tts.sapi
import tts.flags

voice = tts.sapi.Sapi()

voice.say('<PRON SYM = "h eh l ow"/>', tts.flags.SpeechVoiceSpeakFlags.IsXML.value)
voice.say('<speak version="1.0" xmlns="https://www.w3.org/2001/10/synthesis" xml:lang="en-US"><phoneme alphabet="sapi" ph="w er 1 l d"></phoneme></speak>', tts.flags.SpeechVoiceSpeakFlags.IsXML.value)

The SpVoice COM object is available as the voice variable on the instance of the Sapi class. You can access the raw SAPI interface from it. The interface is available at:

https://msdn.microsoft.com/en-us/library/ee125640%28v=vs.85%29.aspx

Properties are assigned and read from, Methods are used like functions. For example, to pause a voice and then to resume it:

voice.voice.Pause()
voice.voice.Resume()

Happy Hacking

tts's People

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.