-
-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5385445
commit 4d62a38
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
examples/examples-tts/streams-talkie-audiokit/streams-talkie-audiokit.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @file streams-talkie-audiokit.ino | ||
* We use the TalkiePCM TTS library to generate the audio | ||
* You need to install https://github.com/pschatzmann/TalkiePCM | ||
* @author Phil Schatzmann | ||
* @copyright GPLv3 | ||
*/ | ||
|
||
#include "AudioTools.h" | ||
#include "AudioTools/AudioLibs/AudioBoardStream.h" //https://github.com/pschatzmann/arduino-audio-driver | ||
#include "TalkiePCM.h" // https://github.com/pschatzmann/TalkiePCM | ||
#include "Vocab_US_Large.h" | ||
|
||
const AudioInfo info(8000, 2, 16); | ||
AudioBoardStream out(AudioKitEs8388V1); // Audio sink | ||
//CsvOutput<int16_t> out(Serial); | ||
TalkiePCM voice(out, info.channels); | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
AudioLogger::instance().begin(Serial, AudioLogger::Info); | ||
// setup AudioKit | ||
auto cfg = out.defaultConfig(); | ||
cfg.copyFrom(info); | ||
out.begin(cfg); | ||
|
||
Serial.println("Talking..."); | ||
} | ||
|
||
void loop() { | ||
voice.say(sp2_DANGER); | ||
voice.say(sp2_DANGER); | ||
voice.say(sp2_RED); | ||
voice.say(sp2_ALERT); | ||
voice.say(sp2_MOTOR); | ||
voice.say(sp2_IS); | ||
voice.say(sp2_ON); | ||
voice.say(sp2_FIRE); | ||
voice.silence(1000); | ||
} |