jscrane/TTS library not working with NodeMCU 1.0
Posted: Sat Apr 22, 2023 9:29 am
The library works well with an arduino nano, but I cant get it to work with the NodeMCU 1.0 esp8266. The library converts text into phenomes which is produced as audio using PWM signals. The github page of the library 2 does mention in its readme that it supports esp8266.
Here is the github page https://github.com/jscrane/TTS
## Supported Hardware
- ATmega328-based Arduinos (e.g., Uno, Pro, Pro Mini, etc.): pins 3, 9, 10
-ESP8266: pins 0 to 16 (with analogWrite())
(It does support others too, but I've mentioned only these)
what do I need to change in the code?
Here is the example code which worked for the nano. changing just the PIN number to the appropriate number of the esp8266 according to its pinout did not work.
Here is the github page https://github.com/jscrane/TTS
## Supported Hardware
- ATmega328-based Arduinos (e.g., Uno, Pro, Pro Mini, etc.): pins 3, 9, 10
-ESP8266: pins 0 to 16 (with analogWrite())
(It does support others too, but I've mentioned only these)
what do I need to change in the code?
Here is the example code which worked for the nano. changing just the PIN number to the appropriate number of the esp8266 according to its pinout did not work.
Code: Select all
#include <TTS.h>
// Media pins
#define PIN 3
//#define LED 13
TTS text2speech(PIN); // default is digital pin 10
void setup() {
// pinMode(LED, OUTPUT);
}
void loop() {
// digitalWrite(LED, !digitalRead(LED));
text2speech.setPitch(6);
text2speech.sayText("Hello master! How are you doin?");
delay(500);
text2speech.setPitch(1);
text2speech.sayText("I am fine, thankyou.");
delay(1000);
}