snapshot
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# Using SAM Speach to Text
|
||||
|
||||
I am providing a simple sketch which generates sound data with the SAM text to speach engine.
|
||||
You need to install https://github.com/pschatzmann/arduino-SAM
|
||||
|
||||
In this demo we provide the result as I2SStream but you can easly replace with any other output stream.
|
||||
|
||||
## External DAC
|
||||
|
||||
for defails see the [Wiki](https://github.com/pschatzmann/arduino-audio-tools/wiki/External-DAC)
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @file streams-sam-i2s.ino
|
||||
* You need to install https://github.com/pschatzmann/SAM
|
||||
* @author Phil Schatzmann
|
||||
* @copyright GPLv3
|
||||
*
|
||||
*/
|
||||
#include "AudioTools.h"
|
||||
#include "sam_arduino.h"
|
||||
//#include "AudioTools/AudioLibs/AudioBoardStream.h"
|
||||
|
||||
|
||||
I2SStream out; // Replace with desired class e.g. AudioBoardStream, AnalogAudioStream etc.
|
||||
SAM sam(out, false);
|
||||
|
||||
// Callback which provides the audio data
|
||||
void outputData(Print *out){
|
||||
}
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
|
||||
|
||||
// start data sink
|
||||
auto cfg = out.defaultConfig();
|
||||
cfg.sample_rate = SAM::sampleRate();
|
||||
cfg.channels = 1;
|
||||
cfg.bits_per_sample = 16;
|
||||
out.begin(cfg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Arduino loop
|
||||
void loop() {
|
||||
Serial.println("providing data...");
|
||||
sam.say("Hallo, my name is Alice");
|
||||
delay(5000);
|
||||
}
|
||||
Reference in New Issue
Block a user