ttsaas

command module
v0.0.0-...-5a2df4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 10 Imported by: 0

README

TTSAAS

Text To Speech As A Service

Dependencies

Be sure to install the following go libraries:

go get github.com/hegedustibor/htgo-tts
go get github.com/kennygrant/sanitize

Also, the htgo-tts package requires mplayer to be installed, or it will throw an error.

sudo apt install mplayer

Finally, we need ffmpeg to increase the volume

sudo apt install ffmpeg

Usage

Setup

You might need to create a folder named audio in the directory of the executable.

Running

Start the project with go run main.go or build and run the executable.

Choosing a port

The service uses port 80 by default, but this can be configured by setting the TTSAAS_PORT environment variable.

API usage

Navigating to localhost:8000/hello%20world will return an mp3 file with "Hello world" spoken out. The content type is audio/mpeg.

HTML audio element example

The api can be used as a source for audio tags. For example:

<audio controls>
  <source src="http://localhost/hello%20world" type="audio/mpeg">
</audio>

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL