Skip to content

Commit f8ab547

Browse files
committed
example for Flite TTS engine
1 parent 8a9fc1e commit f8ab547

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ Here are some examples:
118118

119119
- [streams-generator-webserver_wav](examples/streams-generator-webserver_wav) A Webserver which renders some generated sound
120120
- [streams-sam-webserver_wav](examples/streams-sam-webserver_wav) A Webserver which renders the result from the SAM TTS engine
121-
- [streams-tts-webserver_wav](examples/streams-tts-webserver_wav) A Webserver which renders the result from the SAM TTS engine
121+
- [streams-tts-webserver_wav](examples/streams-tts-webserver_wav) A Webserver which renders the result from the Arduino TTS engine
122+
- [streams-flite-webserver_wav](examples/streams-flite-webserver_wav) A Webserver which renders the result from the Flite TTS engine
122123

123124
#### Logging
124125

@@ -148,6 +149,7 @@ Dependent on the example you might need to install some of the following librari
148149
- [Mozzi](https://github.com/pschatzmann/Mozzi) A sound synthesis library for Arduino
149150
- [SAM](https://github.com/pschatzmann/SAM) A Text to Speach Engine
150151
- [TTS](https://github.com/pschatzmann/TTS) A Text to Speach Engine
152+
- [flite](https://github.com/pschatzmann/flite) A Text to Speach Engine
151153

152154
## Installation
153155

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Using SAM Speach to Text
2+
3+
I am providing a simple sketch which generates sound data with the Flite text to speach engine.
4+
You need to install https://github.com/pschatzmann/flite
5+
6+
In this demo we provide the result as WAV stream which can be listened to in a Web Browser
7+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @file streams-flite-webserver_wav.ino
3+
*
4+
* @author Phil Schatzmann
5+
* @copyright GPLv3
6+
*
7+
*/
8+
9+
#include "flite_arduino.h"
10+
#include "AudioWAVServer.h"
11+
12+
using namespace audio_tools;
13+
14+
AudioWAVServer server("ssid","password");
15+
16+
// Callback which provides the audio data
17+
void outputData(Stream &out){
18+
Serial.print("providing data...");
19+
Flite flite(out);
20+
21+
// Setup Audio Info
22+
FliteOutputBase *o = flite.getOutput();
23+
24+
flite.say("Hallo, my name is Alice");
25+
Serial.printf("info %d, %d, %d", o->sampleRate(), o->channels(), o->bitsPerSample());
26+
}
27+
28+
void setup(){
29+
Serial.begin(115200);
30+
server.begin(outputData, 8000,1,16);
31+
}
32+
33+
34+
// Arduino loop
35+
void loop() {
36+
// Handle new connections
37+
server.doLoop();
38+
}

0 commit comments

Comments
 (0)