pschatzmann/arduino-simple-tts

Ticking noise when it should be silent

LenStruttmann opened this issue · 3 comments

After connecting the Talking Clock to a MAX98357A I2S amplifier, the "ticking" noise when the clock is meant to be silent became very apparent and annoying. It appears that the I2S driver continually sends its last buffer to the bus and, somehow, causes this tick.

Since my I2S device does not support a Mute pin, my workaround for this was the following:

// time at startup // <------------- i2s.begin(); ttt.say(timeInfo.time()); // <------------- i2s.end(); }

void loop() {
// speach output
if (timeInfo.update()){
i2s.begin(); // <-------------
ttt.say(timeInfo.time());
i2s.end(); // <-------------
// tts.say("SILENCE"); // ESP32: prevent noise at end
}
}

The risk with calling end() is, that it is closing I2S immediately and that you risk to loose some audio.
Instead of calling tts.say("SILENCE"); you could also try to add i2s.writeSilence(samples). I am not sure however what the min amount of samples would be e.g. 1024.

Please note that writeSilence has only been added recently (so you might need to update the library if you want to use this)

I tried to reproduce your issue with an AudioKit but I did not get any ticking noise. So I assume this is a feature of the MAX98357A. I am closing this issue because you found a solution in your sketch which does not require a change of the library

Thanks for looking into this and for the suggestions.