Skip to content

Commit 4d62a38

Browse files
committed
Talkie example
1 parent 5385445 commit 4d62a38

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @file streams-talkie-audiokit.ino
3+
* We use the TalkiePCM TTS library to generate the audio
4+
* You need to install https://github.com/pschatzmann/TalkiePCM
5+
* @author Phil Schatzmann
6+
* @copyright GPLv3
7+
*/
8+
9+
#include "AudioTools.h"
10+
#include "AudioTools/AudioLibs/AudioBoardStream.h" //https://github.com/pschatzmann/arduino-audio-driver
11+
#include "TalkiePCM.h" // https://github.com/pschatzmann/TalkiePCM
12+
#include "Vocab_US_Large.h"
13+
14+
const AudioInfo info(8000, 2, 16);
15+
AudioBoardStream out(AudioKitEs8388V1); // Audio sink
16+
//CsvOutput<int16_t> out(Serial);
17+
TalkiePCM voice(out, info.channels);
18+
19+
void setup() {
20+
Serial.begin(115200);
21+
AudioLogger::instance().begin(Serial, AudioLogger::Info);
22+
// setup AudioKit
23+
auto cfg = out.defaultConfig();
24+
cfg.copyFrom(info);
25+
out.begin(cfg);
26+
27+
Serial.println("Talking...");
28+
}
29+
30+
void loop() {
31+
voice.say(sp2_DANGER);
32+
voice.say(sp2_DANGER);
33+
voice.say(sp2_RED);
34+
voice.say(sp2_ALERT);
35+
voice.say(sp2_MOTOR);
36+
voice.say(sp2_IS);
37+
voice.say(sp2_ON);
38+
voice.say(sp2_FIRE);
39+
voice.silence(1000);
40+
}

0 commit comments

Comments
 (0)