Skip to content

rlinke/Python-Bing-TTS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python-Bing-TTS

Microsoft Bing Text to Speech library for Python

Installation

To install using pip, run the following command:

pip install git+https://github.com/westparkcom/Python-Bing-TTS.git

To install using pipenv, run the following command:

pipenv install git+https://github.com/westparkcom/Python-Bing-TTS.git#egg=bingtts

Usage

The following is the usage of the library

translator.speak(text, language, voice, fileformat)
Variable Description Note
text The text that you wish to convert to speech
language The language/country you wish to hear the speech in Case sensitive. See Bing TTS API Reference for list
voice The name of the voice to use Case sensitive
fileformat File format to encode the speech to See Bing TTS API Reference for list of formats

Example

from bingtts import Translator
translator = Translator('YOUR-API-KEY-HERE')
output = translator.speak("This is a text to speech translation", "en-US", "JessaRUS", "riff-16khz-16bit-mono-pcm")
with open("file.wav", "wb") as f:
    f.write(output)

About

Microsoft Bing Text to Speech library for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%