Skip to main content

The GoogleASR incremental module for the retico framework

Project description

retico-googletts

This project contains the incremental module for running Google Cloud TTS in a retico environment. Google TTS provides multiple languages and voices, which can be looked up here.

The current implementation of the TTS module is not strictly incremental, as a new input triggers a complete resynthesizing of the speech.

How to install

Although the installation of retico-googletts only requires retico-core, there are a few software dependencies that have to be installed manually

GCloud

For the authentication with the Google TTS API, the command line argument gcloud has to be availbale. For information visit the Google Cloud Documentation. To validate that the access work, the following command has to return the access token to authenticate the use of the API:

$ gcloud auth print-access-token

ffmpeg

In order to convert the received audio files into the proper format, retico-googletts requires ffmpeg.

Documentation

Sadly, there is no proper documentation for retico-googletts right now, but you can start using the GoogleTTSModule like this:

from retico_core import *
from retico_googleasr import *
from retico_googletts import *


def callback(update_msg):
    for x, ut in update_msg:
        print(f"{ut}: {x.text} ({x.stability}) - {x.final}")


m1 = audio.MicrophoneModule()
m2 = GoogleASRModule()
m3 = text.TextDispatcherModule()
m4 = GoogleTTSModule("en-US", "en-US-Wavenet-A")
m5 = audio.AudioDispatcherModule(target_frame_length=0.2)
m6 = audio.StreamingSpeakerModule(frame_length=0.2)
m7 = debug.CallbackModule(callback)

m1.subscribe(m2)
m2.subscribe(m3)
m3.subscribe(m4)
m4.subscribe(m5)
m2.subscribe(m7)
m5.subscribe(m6)

network.run(m1)

print("Running")
input()

network.stop(m1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retico-googletts-0.1.3.tar.gz (10.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page