Esp32 and audio (text to speech)
Posted: Mon Sep 17, 2018 11:44 am
Hello Geeks,
i have an RFID card Scanning System, I wanna include audio Output into this.
What I wanna do is whenever an RFID card is Scanned, I want AUDIO output WELCOME "ANKIT"
I don't wanna play any audio file like (.mp3, wav ,etc)
so what I'm after is "TEXT TO SPEECH CONVERSION" AND I WANNA PLAY THAT TEXT WRITTEN IN CODE.
there are two libraries TALKIE.H and TTS.H. they both work fine with Arduino.
here is the code
Can i achieve this ON ESP32 ??
I don't wanna play any audio file.
is there any way to achieve this using i2s protocol?
any guidance is appreciated..
THANKS..
i have an RFID card Scanning System, I wanna include audio Output into this.
What I wanna do is whenever an RFID card is Scanned, I want AUDIO output WELCOME "ANKIT"
I don't wanna play any audio file like (.mp3, wav ,etc)
so what I'm after is "TEXT TO SPEECH CONVERSION" AND I WANNA PLAY THAT TEXT WRITTEN IN CODE.
there are two libraries TALKIE.H and TTS.H. they both work fine with Arduino.
here is the code
Code: Select all
#include <TTS.h>
// Media pins
#define ledPin 13 // digital pin 13
// Variables
char text [50];
boolean state=0;
TTS text2speech; // speech output is digital pin 10
void setup() {
//media
pinMode(ledPin, OUTPUT);
}
//================================================================
// Main Loop
//================================================================
void loop(){
state = !state;
digitalWrite(ledPin, state);
Test_Speech();
delay(1000); // delay a second
}
//================================================================
void Test_Speech() {
text2speech.setPitch(6); //higher values = lower voice pitch
strcpy(text, "Hello master! How are you doin?");
text2speech.say(text);
delay(500);
text2speech.setPitch(1); //lower values = higher voice pitch
strcpy(text, "I am fine, thankyou.");
text2speech.say(text);
}
Can i achieve this ON ESP32 ??
I don't wanna play any audio file.
is there any way to achieve this using i2s protocol?
any guidance is appreciated..
THANKS..