File tree Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ class AudioSourceSDMMC : public AudioSource {
3838 setup_index = setupIndex;
3939 }
4040
41+ virtual ~AudioSourceSDMMC () {
42+ end ();
43+ }
44+
4145 virtual bool begin () override {
4246 TRACED ();
4347 if (!is_sd_setup) {
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ class AudioSourceSPIFFS : public AudioSource {
2020 start_path = startFilePath;
2121 exension = ext;
2222 }
23+
24+ virtual ~AudioSourceSPIFFS () {
25+ end ();
26+ }
2327
2428 virtual bool begin () override {
2529 TRACED ();
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ class AudioSourceSTD : public AudioSource {
2525 timeout_auto_next_value = 600000 ;
2626 }
2727
28+ virtual ~AudioSourceSTD () {
29+ end ();
30+ }
31+
2832 virtual bool begin () override {
2933 TRACED ();
3034 idx_pos = 0 ;
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class AudioSourceURL : public AudioSource {
2626 this ->pos = startPos - 1 ;
2727 this ->timeout_auto_next_value = 20000 ;
2828 }
29+
30+ virtual ~AudioSourceURL () {
31+ end ();
32+ }
33+
2934
3035 // / Setup Wifi URL
3136 virtual bool begin () override {
@@ -34,6 +39,11 @@ class AudioSourceURL : public AudioSource {
3439 return true ;
3540 }
3641
42+ void end () {
43+ if (started) actual_stream->end ();
44+ started = false ;
45+ }
46+
3747 // / Opens the selected url from the array
3848 Stream* selectStream (int idx) override {
3949 pos = idx;
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ class AudioSourceVFS : public AudioSource {
3636 exension = ext;
3737 }
3838
39+ virtual ~AudioSourceVFS () {
40+ end ();
41+ }
42+
43+
3944 virtual bool begin () override {
4045 TRACED ();
4146 idx_pos = 0 ;
You can’t perform that action at this time.
0 commit comments