Skip to content

m0rniac/rspeechpy

Repository files navigation

PSpeechPy

A Text To Speech engine with realistic voices developed entirely in Python and powered by Microsoft Azure as Python Package

Based:

Installation (Python 3.X+)

  • Linux:
pip3 install rspeechpy
  • Windows:
pip install rspeechpy

Usage & Examples (Scripts)

  • List all avaible voices:
import asyncio
from rspeechpy import Engine

# Declaration
speech = Engine()

async def example():
    names = await speech.giveVoicesList()
    for name in names:
        print(name['FriendlyName'])     # Describe voice's name & language.
        print(name['ShortName'])       # Return "key" to use that voice.

# Running
app = asyncio.get_event_loop()
app.run_until_complete(example())
  • Create a synthesize from text (Generate .mp3 audio):
import asyncio
from rspeechpy import Engine

# Declaration
speech = Engine()

async def example():
    await speech.setVoice('es-ES-ElviraNeural')
    
    await speech.setRate(5)
    await speech.setPitch(5)
    await speech.setVolume(5)
    
    text = "Hola esto es una prueba de texto a voz"
    await speech.synthesize(text, 'audio.mp3')

# Running
app = asyncio.get_event_loop()
app.run_until_complete(example())

API Reference

from Microsoft Azure:

More documentation

Parameter Type Description
api_key string Non-Required

License:

MIT License

🔗 Sponsoring:

portfolio