Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticking noise when it should be silent #5

Closed
LenStruttmann opened this issue Jan 20, 2023 · 3 comments
Closed

Ticking noise when it should be silent #5

LenStruttmann opened this issue Jan 20, 2023 · 3 comments

Comments

@LenStruttmann
Copy link

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
}
}

@pschatzmann
Copy link
Owner

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)

@pschatzmann
Copy link
Owner

pschatzmann commented Jan 22, 2023

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

@LenStruttmann
Copy link
Author

Thanks for looking into this and for the suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants