Interaction between Audio Resampling and touchRead #1511
-
I am playing a sketch (ESP32-PICO-D4) generating sound from Arrays and both waves are resampled, one is a fixed step and othe has various steps selected by toucgRead pins. The problem I have is the sketch starts up and plays an initial tone, then when I touch a touch pad to select another frequency by changing to another stepsize, I get a break in the tone (short ms) and the tone selected plays OK and touching any other pad works OK from then on, there are no breaks. The problem seem to only be when the step change id quite large (maybe 1.5 to 2.0 etc). If I touch a pad first that has only a small step change there are no breaks and all plays OK. It only happens if first touch pad has a large step ans problem is only that the first change starts with a break even the initial tone is already playing. When I continue pressing the next pads all plays without breaks. I have tried various pins and different setups in the sketch. At compiling it tells me that 44% of memory is used by the sketch. My question therefore .... Is there any interaction with interrupts or timers etc between touch and audio.....Can both work together.....? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I guess the first touch read is doing some initialization which takes more time then the subsequent calls. The other option would be to increase the i2s buffer, so that there is still audio data during this time gap. |
Beta Was this translation helpful? Give feedback.
I guess the first touch read is doing some initialization which takes more time then the subsequent calls.
Why don't you just issue a first call in the setup where you ignore the result, to "warm up" the processing ?
The other option would be to increase the i2s buffer, so that there is still audio data during this time gap.