Proper code for triggering A2DP source with events and SD card? #603
-
Hi, sorry if this has been answered before, but I couldn't find an example on what the code should specifically look like when using the A2DP_Source module under triggered events with an SD card. Here's the code that I currently have - it's based on the example provided by Phil here. My code does work with no issues, however I'm a complete beginner with C and I'm wondering if this is actually the optimal way of doing it or if I'm causing some memory issues down the road.
Two main things I'm confused about here:
Thanks for any and all help, and most of all thank you for this incredible module! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You never close any file: this will lead to some memory leaks... Instead of some button library you can also use the functionality provided by the Audio Tools |
Beta Was this translation helpful? Give feedback.
You never close any file: this will lead to some memory leaks...
I would suggest that you try to close it before you open the next file: e.g. if (sound_file) sound_file.close();
Instead of some button library you can also use the functionality provided by the Audio Tools