• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Text-to-speech server in a small (17.2 MB) Docker image

espeakbox

gliderlabs/alpine + espeak + lame / opus + a golang http server → a text-to-speech server in a ~17 MB Docker image

Usage

To run a container from the latest image on Docker Hub:

docker run --name espeakbox -d -p 8080:8080 parente/espeakbox

Build

Install Docker. Clone this repository and then run:

make build

API

Request:

GET /speech?text=<utterance>
            [&pitch=<0,99; default 50>]
            [&speed=<80,450; default 175 wpm>]
            [&voice=<name; default en>]
            [&encoding=<mp3|opus; default mp3>]

Response:

  • audio/wav (wave), audio/mpeg (mp3) or audio/ogg (opus) on success
  • text/plain with a status code >= 400 on error

Request:

GET /voices

Response:

  • application/json encoding an object with a names list
  • text/plain with a status code >= 400 on error

FAQ

How well does it perform?

My ten-minute effort into benchmarking a single container yields the following on a boot2docker virtual machine with 2 GB RAM and 8 VCPUs hosted on a Macbook with 16 GB RAM, a 2.7 GHz processor, and 4 cores.

$ ab -c 100 -n 1000 'http://192.168.59.103:8080/speech?text=the%20cheese%20flies%20at%20midnight'

This is ApacheBench, Version 2.3 <$Revision: 1554214 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.59.103 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:
Server Hostname:        192.168.59.103
Server Port:            8080

Document Path:          /speech?text=the%20cheese%20flies%20at%20midnight
Document Length:        7105 bytes

Concurrency Level:      100
Time taken for tests:   13.102 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      7187000 bytes
HTML transferred:       7105000 bytes
Requests per second:    76.33 [#/sec] (mean)
Time per request:       1310.172 [ms] (mean)
Time per request:       13.102 [ms] (mean, across all concurrent requests)
Transfer rate:          535.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   16 112.6      3    1038
Processing:   174 1271 689.6   1089    5861
Waiting:      114 1012 697.3    812    5220
Total:        177 1287 698.4   1093    5864

Percentage of the requests served within a certain time (ms)
  50%   1093
  66%   1346
  75%   1555
  80%   1723
  90%   2266
  95%   2751
  98%   3163
  99%   3735
 100%   5864 (longest request)

The same test on a SoftLayer virtual instance with 16 GB RAM and 8 VCPUs yields the following:

$ ab -c 100 -n 1000 'http://127.0.0.1:8080/speech?text=the%20cheese%20flies%20at%20midnight'

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /speech?text=the%20cheese%20flies%20at%20midnight
Document Length:        7105 bytes

Concurrency Level:      100
Time taken for tests:   11.329 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      7187000 bytes
HTML transferred:       7105000 bytes
Requests per second:    88.27 [#/sec] (mean)
Time per request:       1132.892 [ms] (mean)
Time per request:       11.329 [ms] (mean, across all concurrent requests)
Transfer rate:          619.53 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   1.5      0       7
Processing:   389 1110 276.9   1068    2494
Waiting:       72  830 226.3    833    1954
Total:        390 1111 276.8   1068    2495

Percentage of the requests served within a certain time (ms)
  50%   1068
  66%   1230
  75%   1301
  80%   1344
  90%   1465
  95%   1606
  98%   1721
  99%   1793
 100%   2495 (longest request)

License

MIT

More Repositories

1

nbestimate

Estimate of Public Jupyter Notebooks on GitHub
Jupyter Notebook
83
star
2

cookiecutter-flask-react

Cookiecutter for a Flask+React project
Python
24
star
3

dockerfiles

Dockerfiles for things I use personally
Shell
24
star
4

tott

Tools of the Trade website
Shell
17
star
5

z2jh-aws

🥞 Zero-to-JupyterHub with Kubernetes using an opinionated tech stack
Makefile
12
star
6

obsidian-overdue

Obsidian plugin that marks items as [[Overdue]] if they are not checked off by their due date
TypeScript
10
star
7

mostly-tmpnb

Temporary notebook servers, persistent Docker volumes
Python
10
star
8

handlerbag

Bag of dynamic handlers on top of Tornado
Python
6
star
9

homelab

My setup for a homelab kubernetes environment
Smarty
5
star
10

supybot-plugins

Some supybot plugins
Python
4
star
11

how-i-git

Git repository used for a live tutorial at UNC
JavaScript
4
star
12

clique

Perceptually based, task oriented auditory display for GUI applications
Python
4
star
13

marked-html

Render markdown to a complete html document.
JavaScript
3
star
14

kiss

Keep it simple scripting
Python
2
star
15

blog-old

Blog source for mindtrove.info
Jupyter Notebook
2
star
16

spaceship

A JavaScript game for kids using Creative Commons licensed music, sound, speech, and graphics, and the Dojo toolkit.
JavaScript
2
star
17

bbb

Buildbot button extension for Google Chrome
JavaScript
2
star
18

wnerd

Wrestling Nerd: Point-and-click wrestling tournament management.
Python
1
star
19

wcpe

WCPE Chrome Extension
JavaScript
1
star
20

labview-webcam

Ancient LabVIEW webcam library
C
1
star
21

docker-stacker

Build your own jupyter/docker-stacks definition
JavaScript
1
star
22

helloworld-transifex-rtd

Translation CI/CD workflow involving Sphinx, Transifex, GitHub Actions, and ReadTheDocs
1
star
23

nbviewer-provider

🗑☣️ Demo of a simple custom nbviewer provider
Python
1
star
24

sightwords

Simple browser-based HTML5 sightword, reading, and typing tutor for my daughter's Raspberry Pi.
CSS
1
star
25

dojo-a11y-rating

Sample code for an accessible, internationalized Dojo rating widget
JavaScript
1
star