File tree Expand file tree Collapse file tree 8 files changed +27
-23
lines changed Expand file tree Collapse file tree 8 files changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class int24_t {
43
43
set ((int32_t )in);
44
44
}
45
45
46
- #if defined(STM32) || defined(ESP32C3) || defined(TARGET_RP2040)
46
+ #if defined(STM32) || defined(ESP32C3) || defined(TARGET_RP2040) || !defined(ARDUINO)
47
47
48
48
int24_t (const int &in) {
49
49
set (in);
Original file line number Diff line number Diff line change @@ -94,19 +94,6 @@ class MP3EncoderLAME : public AudioEncoder {
94
94
enc->begin ();
95
95
}
96
96
97
- // /**
98
- // * @brief Opens the encoder
99
- // *
100
- // * @param input_channels
101
- // * @param input_sample_rate
102
- // * @param input_bits_per_sample
103
- // */
104
- // void begin(int input_channels, int input_sample_rate, int input_bits_per_sample) {
105
- // TRACED();
106
- // createEnc();
107
- // enc->begin(input_channels, input_sample_rate, input_bits_per_sample);
108
- // }
109
-
110
97
111
98
AudioInfoLAME &audioInfo (){
112
99
return info;
@@ -153,10 +140,13 @@ class MP3EncoderLAME : public AudioEncoder {
153
140
154
141
// Create enc only at begin so that we can use psram
155
142
void createEnc (){
143
+ TRACED ();
156
144
if (enc==nullptr ){
157
145
enc = new liblame::MP3EncoderLAME ();
158
146
if (p_print!=nullptr ){
159
147
setOutputStream (*p_print);
148
+ } else {
149
+ LOGE (" Output undefined" );
160
150
}
161
151
AudioInfoLAME tmp;
162
152
tmp.channels = info.channels ;
Original file line number Diff line number Diff line change 1
1
#pragma once
2
+ #include " AudioConfig.h"
3
+ #ifdef USE_URL_ARDUINO
2
4
3
5
#include " AudioHttp/HttpTypes.h"
4
6
#include " AudioHttp/HttpHeader.h"
@@ -288,3 +290,5 @@ class HttpRequest {
288
290
};
289
291
290
292
}
293
+
294
+ #endif
Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ friend class AudioKitStream;
43
43
result.fmt = toFormat ();
44
44
result.sample_rate = toSampleRate ();
45
45
result.bits_per_sample = toBits ();
46
+ #if defined(ESP32)
46
47
result.buffer_size = buffer_size;
47
48
result.buffer_count = buffer_count;
49
+ #endif
48
50
// we use the AudioKit library only to set up the codec
49
51
result.i2s_active = false ;
50
52
#if AUDIOKIT_SETUP_SD
@@ -67,8 +69,10 @@ friend class AudioKitStream;
67
69
pin_ws = pins.ws_io_num ;
68
70
pin_data = pins.data_out_num ;
69
71
pin_data_rx = pins.data_in_num ;
70
- #if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 4, 0)
72
+ #if defined(ESP32)
73
+ # if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4, 4, 0)
71
74
pin_mck = 0 ;
75
+ # endif
72
76
#endif
73
77
};
74
78
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ extern uint64_t millis();
164
164
165
165
} // namespace
166
166
167
- #if defined(ESP32) || defined(ESP32_CMAKE)
167
+ #if defined(ESP32)
168
168
#include " driver/gpio.h"
169
169
// / e.g. for AudioActions
170
170
int digitalRead (int pin) {
@@ -194,10 +194,6 @@ void pinMode(int pin, int mode) {
194
194
}
195
195
}
196
196
197
- #else
198
- // / e.g. for AudioActions
199
- int digitalRead (int pin);
200
- void pinMode (int pin, int mode);
201
197
#endif
202
198
203
199
using namespace audio_tools ;
Original file line number Diff line number Diff line change 1
1
#pragma once
2
-
3
2
#include < stdlib.h>
3
+ #include " AudioConfig.h"
4
4
#include " AudioTools/AudioTypes.h"
5
5
#include " AudioTools/AudioStreams.h"
6
6
#include " AudioMetaData/MetaDataICY.h"
@@ -41,6 +41,8 @@ class MetaDataPrint : public AudioPrint {
41
41
callback = fn;
42
42
}
43
43
44
+ #ifdef USE_URL_ARDUINO
45
+
44
46
// / Starts the processing - iceMetaint is determined from the HttpRequest
45
47
virtual void begin (HttpRequest &http) {
46
48
TRACED ();
@@ -49,13 +51,18 @@ class MetaDataPrint : public AudioPrint {
49
51
icySetup.executeCallback (callback);
50
52
begin (metaInt);
51
53
}
54
+ #endif
52
55
53
56
// / Starts the processing - if iceMetaint is defined we use icecast
54
57
virtual void begin (int iceMetaint=0 ) {
55
58
LOGD (" %s: %d" , LOG_METHOD, iceMetaint);
56
59
if (callback!=nullptr ){
57
60
if (meta == nullptr ) {
61
+ #if defined(USE_URL_ARDUINO)
58
62
meta = (iceMetaint > 0 ) ? new MetaDataICY () : (AbstractMetaData *) new MetaDataID3 ();
63
+ #else
64
+ meta = new MetaDataID3 ();
65
+ #endif
59
66
}
60
67
meta->setCallback (callback);
61
68
meta->setIcyMetaInt (iceMetaint);
Original file line number Diff line number Diff line change 1
1
#pragma once
2
+ #include " AudioConfig.h"
3
+ #ifdef USE_URL_ARDUINO
2
4
3
5
#include " AudioMetaData/AbstractMetaData.h"
4
6
#include " AudioBasic/Str.h"
@@ -305,4 +307,6 @@ class ICYUrlSetup {
305
307
306
308
};
307
309
308
- }
310
+ }
311
+
312
+ #endif
Original file line number Diff line number Diff line change @@ -266,7 +266,6 @@ T readSample(Stream* p_stream){
266
266
// / guaranteed to return the requested data
267
267
template <typename T>
268
268
size_t readSamples (Stream* p_stream, T* data, int samples){
269
- T result=0 ;
270
269
uint8_t *p_result = (uint8_t *) data;
271
270
int open = samples*sizeof (T);
272
271
int total = 0 ;
You can’t perform that action at this time.
0 commit comments