From 4d62a3861f212644a7b396cb74e76786e97d30c6 Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Mon, 21 Oct 2024 14:08:26 +0200 Subject: [PATCH] Talkie example --- .../streams-talkie-audiokit.ino | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 examples/examples-tts/streams-talkie-audiokit/streams-talkie-audiokit.ino diff --git a/examples/examples-tts/streams-talkie-audiokit/streams-talkie-audiokit.ino b/examples/examples-tts/streams-talkie-audiokit/streams-talkie-audiokit.ino new file mode 100644 index 000000000..49245e3fe --- /dev/null +++ b/examples/examples-tts/streams-talkie-audiokit/streams-talkie-audiokit.ino @@ -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 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); +} \ No newline at end of file