MemoryStream avoid autoplay when turn up #1275
-
Hi! I'm using the memorystream class for playing a raw file when i press a button. So i wan't the files to not start automatically when i turn up the ESP32, i was trying with the end() function but didn't work. Here is the sketch:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
With the current implementation, adding copier.setActive(false) to the setup() and copier.setActive(true) to the playButton() should do the trick. I committed a change that sets MemoryStream to be inactive when you call end(), so if you upgrade, your solution should work w/o any change as well or instead of calling end() you could set it to inactive in the constructor e.g. with MemoryStream music(hihat_raw, hihat_raw_len, false); |
Beta Was this translation helpful? Give feedback.
With the current implementation, adding copier.setActive(false) to the setup() and copier.setActive(true) to the playButton() should do the trick.
I committed a change that sets MemoryStream to be inactive when you call end(), so if you upgrade, your solution should work w/o any change as well or instead of calling end() you could set it to inactive in the constructor e.g. with MemoryStream music(hihat_raw, hihat_raw_len, false);