File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ class AACDecoderHelix : public CommonHelix {
21
21
AACDecoderHelix () {
22
22
}
23
23
24
+ #ifdef ARDUINO
24
25
AACDecoderHelix (Print &output, AACInfoCallback infoCallback=nullptr ){
25
26
this ->out = &output;
26
27
this ->infoCallback = infoCallback;
27
28
}
28
-
29
+ # endif
29
30
AACDecoderHelix (AACDataCallback dataCallback){
30
31
this ->pwmCallback = dataCallback;
31
32
}
@@ -37,10 +38,6 @@ class AACDecoderHelix : public CommonHelix {
37
38
this ->pwmCallback = cb;
38
39
}
39
40
40
- void setOutput (Print &output){
41
- this ->out = &output;
42
- }
43
-
44
41
// / Starts the processing
45
42
void begin (){
46
43
LOG (Debug, " begin" );
@@ -133,7 +130,9 @@ class AACDecoderHelix : public CommonHelix {
133
130
if (info.sampRateOut !=aacFrameInfo.sampRateOut && infoCallback!=nullptr ){
134
131
infoCallback (info);
135
132
}
133
+ #ifdef ARDUINO
136
134
out->write ((uint8_t *)pwm_buffer, info.outputSamps );
135
+ #endif
137
136
}
138
137
aacFrameInfo = info;
139
138
}
Original file line number Diff line number Diff line change 1
1
#pragma once
2
+
3
+ #ifdef ARDUINO
2
4
#include " Arduino.h"
5
+ #endif
3
6
4
7
// User Settings: Activate/Deactivate logging
5
8
#ifndef HELIX_LOGGING_ACTIVE
@@ -57,6 +60,12 @@ class CommonHelix {
57
60
}
58
61
}
59
62
63
+ #ifdef ARDUINO
64
+ void setOutput (Print &output){
65
+ this ->out = &output;
66
+ }
67
+ #endif
68
+
60
69
/* *
61
70
* @brief Starts the processing
62
71
*
@@ -126,8 +135,9 @@ class CommonHelix {
126
135
127
136
protected:
128
137
bool active = false ;
138
+ #ifdef ARDUINO
129
139
Print *out = nullptr ;
130
- Stream *in = nullptr ;
140
+ # endif
131
141
uint32_t buffer_size = 0 ; // actually filled sized
132
142
uint8_t *frame_buffer = nullptr ;
133
143
short *pwm_buffer = nullptr ;
Original file line number Diff line number Diff line change @@ -28,12 +28,13 @@ class MP3DecoderHelix : public CommonHelix {
28
28
this ->mp3_type = MP3Normal;
29
29
}
30
30
31
+ #ifdef ARDUINO
31
32
MP3DecoderHelix (Print &output, MP3Type mp3Type=MP3Normal, MP3InfoCallback infoCallback=nullptr ){
32
33
this ->out = &output;
33
34
this ->infoCallback = infoCallback;
34
35
this ->mp3_type = mp3Type;
35
36
}
36
-
37
+ # endif
37
38
MP3DecoderHelix (MP3DataCallback dataCallback, MP3Type mp3Type=MP3Normal){
38
39
this ->pwmCallback = dataCallback;
39
40
this ->mp3_type = mp3Type;
@@ -51,11 +52,6 @@ class MP3DecoderHelix : public CommonHelix {
51
52
this ->pwmCallback = cb;
52
53
}
53
54
54
- void setOutput (Print &output){
55
- this ->out = &output;
56
- }
57
-
58
-
59
55
// / Starts the processing
60
56
void begin (){
61
57
LOG (Debug, " begin" );
@@ -155,7 +151,9 @@ class MP3DecoderHelix : public CommonHelix {
155
151
if (info.samprate !=mp3FrameInfo.samprate && infoCallback!=nullptr ){
156
152
infoCallback (mp3FrameInfo);
157
153
}
154
+ #ifdef ARDUINO
158
155
out->write ((uint8_t *)pwm_buffer, info.outputSamps );
156
+ #endif
159
157
}
160
158
mp3FrameInfo = info;
161
159
}
You can’t perform that action at this time.
0 commit comments