website/content/blog/espeak.md

47 lines
1.4 KiB
Markdown
Raw Normal View History

2020-03-07 14:54:12 -05:00
---
2023-01-18 11:50:40 -05:00
title: "Text to Speech on Linux with Espeak"
2020-03-07 14:54:12 -05:00
date: 2020-03-01T10:33:33-05:00
draft: false
2022-11-12 11:22:54 -05:00
tags: []
2023-01-05 14:04:45 -05:00
medium_enabled: true
2020-03-07 14:54:12 -05:00
---
`espeak` is a command line tool that lets you type in messages and have it said back to you.
To install on Ubuntu
```bash
sudo apt install espeak
```
It's as simple as running it and typing out what you want to say
2022-06-11 22:54:02 -04:00
![](/files/images/blog/20200301113507984.png)
2020-03-07 14:54:12 -05:00
{{< addaudio "/files/audio/20200301113507984.mp3" >}}
[Delightly Linux](https://delightlylinux.wordpress.com/2015/03/23/linux-has-voice-with-espeak/) wrote a great post describing the different features `espeak` has.
Playing around with different voices and I can get something like this:
2022-06-11 22:54:02 -04:00
![](/files/images/blog/20200301115220550.png)
2020-03-07 14:54:12 -05:00
{{< addaudio "/files/audio/20200301115220550.mp3" >}}
You can also replicate the sound above by piping the text into `espeak`
```bash
echo "Warning warning the build has failed" | espeak -s 140 -v en+f4
```
## Subset of Arguments
| Argument | Description |
| -------- | -------------------------------------------- |
| -f | Text file to speak |
| -p | Pitch adjustment from 0 to 99 (default: 50) |
| -s | Speed in words per minute (default: 160) |
| -v | Voice file from `espeak-data/voices` |
| -w | Write output to WAV file instead of speakers |