Hi Hank
I think you can get the comparator to interrupt you at every zero crossing. That is the easy part.
What I suggest is setup the framework to get the zero crossing detector (ZCD) interrupts when the comparator threshold is breached.
1 - enable the ZCD interrupts only when the switch is pressed.
2 - On interrupt, do your audio switching thing which will be within a fraction of a mS away from the Zero crossing. That depends on whether you use the leading edge or trailing edge for trigger; disable the interrupt again so you have just 1 event per switch press
3 - wait for switch release
Hope that helps
Jerson
Bookmarks