Skip to content

Commit 4cf6be3

Browse files
committed
Compile errors in examples
1 parent c750482 commit 4cf6be3

File tree

14 files changed

+76
-52
lines changed

14 files changed

+76
-52
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
docs/html/
22
build/
3-
.vscode/
3+
.vscode/
4+
_deps/
5+
.ipynb_checkpoints/
6+
.DS_Store

examples/build-examples-log.txt

+36-29
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,21 @@
1414
../examples/examples-stream/streams-adc-serial -> rc=0
1515
../examples/examples-stream/streams-adsr-i2s -> rc=0
1616
../examples/examples-stream/streams-generator-analog -> rc=0
17-
../examples/examples-stream/streams_generator_bin_serial -> rc=0
17+
../examples/examples-stream/streams-generator-bin-serial -> rc=0
1818
../examples/examples-stream/streams-generator-formatconverter-i2s -> rc=0
1919
../examples/examples-stream/streams-generator_fromarray-analog -> rc=0
2020
../examples/examples-stream/streams-generator-i2s -> rc=0
2121
../examples/examples-stream/streams-generator-merge-pwm -> rc=0
2222
../examples/examples-stream/streams-generator-pwm -> rc=0
2323
../examples/examples-stream/streams-generator-serial -> rc=0
2424
../examples/examples-stream/streams-generator-spdif -> rc=0
25+
../examples/examples-stream/streams-generator-timedstream-serial -> rc=0
2526
../examples/examples-stream/streams-generator-volume -> rc=0
2627
../examples/examples-stream/streams-generator-wm8960 -> rc=0
2728
../examples/examples-stream/streams-i2s-filter-i2s -> rc=0
2829
../examples/examples-stream/streams-i2s-i2s -> rc=0
2930
../examples/examples-stream/streams-i2s-i2s-2 -> rc=0
30-
../examples/examples-stream/streams-i2s_pdm-serial -> rc=0
31+
../examples/examples-stream/streams-i2s_pdm-serial -> rc=1
3132
../examples/examples-stream/streams-i2s-serial -> rc=0
3233
../examples/examples-stream/streams-i2s-serial_16bit -> rc=0
3334
../examples/examples-stream/streams-i2s-tf -> rc=0
@@ -69,20 +70,21 @@
6970
../examples/examples-audiokit/streams-generator_sinfromtable-audiokit -> rc=0
7071
../examples/examples-audiokit/streams-memory_mp3-audiokit -> rc=0
7172
../examples/examples-audiokit/streams-memory_pcm-mixer-audiokit -> rc=0
72-
../examples/examples-audiokit/streams-pins-audiokit -> rc=0
73-
../examples/examples-audiokit/streams-sd-audiokit -> rc=0
73+
../examples/examples-audiokit/streams-pins-audiokit -> rc=1
74+
../examples/examples-audiokit/streams-sd_flac-audiokit -> rc=0
7475
../examples/examples-audiokit/streams-sdmmc_wav-audiokit -> rc=0
76+
../examples/examples-audiokit/streams-sd_mp3-audiokit -> rc=0
7577
../examples/examples-audiokit/streams-synth-audiokit -> rc=0
7678
../examples/examples-audiokit/streams-synthbasic1-audiokit -> rc=0
7779
../examples/examples-audiokit/streams-synthbasic2-audiokit -> rc=0
78-
../examples/examples-audiokit/streams-synthbasic3-audiokit -> rc=1
80+
../examples/examples-audiokit/streams-synthbasic3-audiokit -> rc=0
7981
../examples/examples-audiokit/streams-synthstk-audiokit -> rc=0
8082
../examples/examples-audiokit/streams-tf-audiokit -> rc=0
8183
../examples/examples-tts/streams-azure_tts-i2s -> rc=0
82-
../examples/examples-tts/streams-espeak-audiokit -> rc=0
83-
../examples/examples-tts/streams-espeak-i2s -> rc=0
84-
../examples/examples-tts/streams-flite-audiokit -> rc=0
85-
../examples/examples-tts/streams-flite-i2s -> rc=0
84+
../examples/examples-tts/streams-espeak-audiokit -> rc=1
85+
../examples/examples-tts/streams-espeak-i2s -> rc=1
86+
../examples/examples-tts/streams-flite-audiokit -> rc=1
87+
../examples/examples-tts/streams-flite-i2s -> rc=1
8688
../examples/examples-tts/streams-google-audiokit -> rc=0
8789
../examples/examples-tts/streams-sam-audiokit -> rc=0
8890
../examples/examples-tts/streams-sam-i2s -> rc=0
@@ -135,25 +137,25 @@
135137
../examples/examples-dsp/examples-faust/streams-i2s-faust_copy-i2s -> rc=0
136138
../examples/examples-dsp/examples-faust/streams-i2s-faust_guitarix-i2s -> rc=0
137139
../examples/examples-dsp/examples-faust/streams-i2s-faust_pitchshift-i2s -> rc=0
138-
../examples/examples-communication/a2dp/base-adc-a2dp -> rc=0
139-
../examples/examples-communication/a2dp/base-generator-a2dp -> rc=0
140-
../examples/examples-communication/a2dp/base-i2s-a2dp -> rc=0
141-
../examples/examples-communication/a2dp/base-player-a2dp -> rc=0
142140
../examples/examples-communication/a2dp/basic-a2dp-audiokit -> rc=0
143141
../examples/examples-communication/a2dp/basic-a2dp-eq-audiokit -> rc=0
144142
../examples/examples-communication/a2dp/basic-a2dp-fft -> rc=0
145143
../examples/examples-communication/a2dp/basic-a2dp-fft-led -> rc=0
146-
../examples/examples-communication/a2dp/basic-a2dp-i2s -> rc=1
144+
../examples/examples-communication/a2dp/basic-a2dp-i2s -> rc=0
147145
../examples/examples-communication/a2dp/basic-a2dp-mixer-i2s -> rc=0
148-
../examples/examples-communication/a2dp/basic-a2dp-spdif -> rc=0
146+
../examples/examples-communication/a2dp/basic-adc-a2dp -> rc=0
149147
../examples/examples-communication/a2dp/basic-audiokit-a2dp -> rc=0
148+
../examples/examples-communication/a2dp/basic-generator-a2dp -> rc=0
149+
../examples/examples-communication/a2dp/basic-i2s-a2dp -> rc=0
150+
../examples/examples-communication/a2dp/basic-player-a2dp -> rc=0
150151
../examples/examples-communication/a2dp/player-sd_a2dp-audiokit -> rc=0
151152
../examples/examples-communication/a2dp/player-sdfat-a2dp -> rc=0
152153
../examples/examples-communication/a2dp/streams-a2dp-audiokit -> rc=0
153154
../examples/examples-communication/a2dp/streams-a2dp-serial -> rc=0
155+
../examples/examples-communication/a2dp/streams-a2dp-spdif -> rc=0
154156
../examples/examples-communication/a2dp/streams-generator-a2dp -> rc=0
155157
../examples/examples-communication/a2dp/streams-i2s-a2dp -> rc=0
156-
../examples/examples-communication/a2dp/streams-synth-a2dp -> rc=1
158+
../examples/examples-communication/a2dp/streams-synth-a2dp -> rc=0
157159
../examples/examples-communication/esp-now/codec/communication-codec-espnow-receive -> rc=0
158160
../examples/examples-communication/esp-now/codec/communication-codec-espnow-receive_measure -> rc=0
159161
../examples/examples-communication/esp-now/codec/communication-codec-espnow-send -> rc=0
@@ -172,24 +174,25 @@
172174
../examples/examples-communication/vban/streams-audiokit-vban -> rc=0
173175
../examples/examples-communication/vban/streams-generator-vban -> rc=0
174176
../examples/examples-communication/vban/streams-vban-audiokit -> rc=0
175-
../examples/examples-communication/rtsp/communication-audiokit-rtsp -> rc=1
176-
../examples/examples-communication/rtsp/communication-codec-rtsp -> rc=1
177-
../examples/examples-communication/rtsp/communication-generator-rtsp -> rc=1
177+
../examples/examples-communication/rtsp/communication-audiokit-rtsp -> rc=0
178+
../examples/examples-communication/rtsp/communication-codec-rtsp -> rc=0
179+
../examples/examples-communication/rtsp/communication-generator-rtsp -> rc=0
178180
../examples/examples-communication/rtsp/communication-rtsp-audiokit -> rc=0
179181
../examples/examples-communication/rtsp/communication-rtsp-i2s -> rc=0
180182
../examples/examples-communication/serial/send-8bit-receive -> rc=0
181-
../examples/examples-communication/serial/send-adpcm_framed-receive -> rc=1
183+
../examples/examples-communication/serial/send-adpcm_framed-receive -> rc=0
182184
../examples/examples-communication/serial/send-adpcm-receive -> rc=0
183185
../examples/examples-communication/serial/send-receive -> rc=0
184-
../examples/examples-communication/snapcast/snapclient-i2s -> rc=1
186+
../examples/examples-communication/snapcast/snapclient-i2s -> rc=0
185187
../examples/examples-communication/spi/spi-master -> rc=0
186188
../examples/examples-communication/spi/spi-slave-esp32 -> rc=0
187189
../examples/examples-communication/spi/spi-slave-rp2040 -> rc=1
188190
../examples/examples-communication/http-client/player-url-i2s -> rc=0
189191
../examples/examples-communication/http-client/player-url_icy-audiokit -> rc=0
190192
../examples/examples-communication/http-client/player-url_icy-i2s -> rc=0
191193
../examples/examples-communication/http-client/player-url_subclass-i2s -> rc=0
192-
../examples/examples-communication/http-client/streams-eth_url_mp3_helix-i2s -> rc=1
194+
../examples/examples-communication/http-client/streams-eth_url_mp3_helix-i2s -> rc=0
195+
../examples/examples-communication/http-client/streams-http_post -> rc=0
193196
../examples/examples-communication/http-client/streams-url_aac-audiokit -> rc=0
194197
../examples/examples-communication/http-client/streams-url_aac-i2s -> rc=0
195198
../examples/examples-communication/http-client/streams-url-file -> rc=0
@@ -202,7 +205,8 @@
202205
../examples/examples-communication/http-client/streams-url_mp3_mad-i2s -> rc=0
203206
../examples/examples-communication/http-client/streams-url_mp3-metadata -> rc=0
204207
../examples/examples-communication/http-client/streams-url_mp3-metadata2 -> rc=0
205-
../examples/examples-communication/http-client/streams-url_mts-hex -> rc=1
208+
../examples/examples-communication/http-client/streams-url_mts-hex -> rc=0
209+
../examples/examples-communication/http-client/streams-url_post -> rc=0
206210
../examples/examples-communication/http-client/streams-url_raw-i2s -> rc=0
207211
../examples/examples-communication/http-client/streams-url_raw-serial -> rc=0
208212
../examples/examples-communication/http-client/streams-url_vorbis_i2s -> rc=0
@@ -233,7 +237,7 @@
233237
../examples/tests/codecs/test-codec-adpcm-xq -> rc=0
234238
../examples/tests/codecs/test-codec-aptx -> rc=0
235239
../examples/tests/codecs/test-codec-base64 -> rc=0
236-
../examples/tests/codecs/test-codec-codec2 -> rc=0
240+
../examples/tests/codecs/test-codec-codec2 -> rc=1
237241
../examples/tests/codecs/test-codec-flac -> rc=0
238242
../examples/tests/codecs/test-codec-g711_alaw -> rc=0
239243
../examples/tests/codecs/test-codec-g711_ulaw -> rc=0
@@ -248,20 +252,22 @@
248252
../examples/tests/codecs/test-codec-opus -> rc=0
249253
../examples/tests/codecs/test-codec-opusogg -> rc=0
250254
../examples/tests/codecs/test-codec-sbc -> rc=0
251-
../examples/tests/codecs/test-compile-all -> rc=1
255+
../examples/tests/codecs/test-compile-all -> rc=0
252256
../examples/tests/codecs/test-container-binary -> rc=0
253257
../examples/tests/codecs/test-container-binary-meta -> rc=0
254258
../examples/tests/codecs/test-container-ogg -> rc=0
255259
../examples/tests/codecs/test-memory-helix -> rc=0
256260
../examples/tests/codecs/test-mp3-helix -> rc=0
257261
../examples/tests/codecs/test-mp3-helix-reading -> rc=0
258-
../examples/tests/codecs/test-mp3-mad -> rc=0
259-
../examples/tests/codecs/test-streaming-adapter -> rc=0
260-
../examples/tests/communications/* -> rc=1
261262
../examples/tests/concurrency/NBuffer -> rc=0
262263
../examples/tests/concurrency/synchBufferRTOS -> rc=0
263264
../examples/tests/concurrency/synchNBuffer -> rc=0
264265
../examples/tests/concurrency/synchRingBuffer -> rc=0
266+
../examples/tests/conversion/channel-converter-avg -> rc=0
267+
../examples/tests/conversion/channel-converter-bin -> rc=0
268+
../examples/tests/conversion/channel-converter-bindiff -> rc=0
269+
../examples/tests/conversion/channel-converter-decimate -> rc=0
270+
../examples/tests/conversion/channel-converter-diff -> rc=0
265271
../examples/tests/conversion/channel-converter-increase-in -> rc=0
266272
../examples/tests/conversion/channel-converter-increase-out -> rc=0
267273
../examples/tests/conversion/channel-converter-reduce-in -> rc=0
@@ -289,10 +295,11 @@
289295
../examples/tests/fft/fft-cmsis -> rc=1
290296
../examples/tests/fft/fft-esp32 -> rc=0
291297
../examples/tests/fft/fft-espressif -> rc=0
292-
../examples/tests/fft/fft-kiss -> rc=0
298+
../examples/tests/fft/fft-kiss -> rc=1
293299
../examples/tests/fft/fft-real -> rc=0
294300
../examples/tests/fft/fft-topn -> rc=0
295301
../examples/tests/fft/fft-window -> rc=0
302+
../examples/tests/filters/test-90deg -> rc=0
296303
../examples/tests/filters/test-filter -> rc=0
297304
../examples/tests/filters/test-median-filter -> rc=0
298305
../examples/tests/performance/mp3-Speed -> rc=0

examples/examples-communication/serial/send-adpcm_framed-receive/send-adpcm_framed-receive.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ADPCMEncoder enc(AV_CODEC_ID_ADPCM_IMA_WAV);
2828
ADPCMDecoder dec(AV_CODEC_ID_ADPCM_IMA_WAV);
2929
BinaryContainerEncoder bin_enc(&enc);
3030
BinaryContainerDecoder bin_dec(&dec);
31-
EncodedAudioStream enc_stream(&serial, &bin_enc);
32-
EncodedAudioStream dec_stream(&out, &bin_dec);
31+
EncodedAudioOutput enc_stream(&serial, &bin_enc);
32+
EncodedAudioOutput dec_stream(&out, &bin_dec);
3333
Throttle throttle(enc_stream);
3434
static int frame_size = 498;
3535
StreamCopy copierOut(throttle, sound, frame_size); // copies sound into Serial

examples/examples-communication/snapcast/snapclient-i2s/snapclient-i2s.h renamed to examples/examples-communication/snapcast/snapclient-i2s/snapclient-i2s.ino

+14-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@
2424

2525
OpusAudioDecoder opus;
2626
I2SStream out;
27-
SnapClient client(out, opus);
27+
WiFiClient wifi;
28+
SnapTimeSyncDynamic synch(172, 10); // optional configuratioin
29+
SnapClient client(wifi, out, opus);
2830

2931
void setup() {
3032
Serial.begin(115200);
31-
// login to wifi
33+
34+
// login to wifi -> Define values in SnapConfig.h or replace them here
3235
WiFi.begin(CONFIG_WIFI_SSID, CONFIG_WIFI_PASSWORD);
3336
Serial.print("Connecting to WiFi ..");
3437
while (WiFi.status() != WL_CONNECTED) {
@@ -42,13 +45,18 @@ void setup() {
4245

4346
// setup I2S to define custom pins
4447
auto cfg = out.defaultConfig();
45-
config.pin_bck = 14;
46-
config.pin_ws = 15;
47-
config.pin_data = 22;
48+
cfg.pin_bck = 14;
49+
cfg.pin_ws = 15;
50+
cfg.pin_data = 22;
51+
//cfg.buffer_size = 512;
52+
//cfg.buffer_count = 6;
4853
out.begin(cfg);
4954

55+
// Define CONFIG_SNAPCAST_SERVER_HOST in SnapConfig.h or here
56+
// client.setServerIP(IPAddress(192,168,1,38));
57+
5058
// start snap client
51-
client.begin();
59+
client.begin(synch);
5260
}
5361

5462
void loop() {

examples/examples-dsp/examples-mozzi/audio_input/audio_input.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void setup() {
4343

4444
void updateControl() {}
4545

46-
int updateAudio() {
46+
mozzi_ns::AudioOutput updateAudio() {
4747
int asig = mozzi.getAudioInput(); // range 0-1023
4848
asig = asig - 512; // now range is -512 to 511
4949
// output range in STANDARD mode is -244 to 243,

examples/examples-dsp/examples-mozzi/control_gain-a2dp/control_gain-a2dp.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void updateControl() {
5353
gain = gain - 3;
5454
}
5555

56-
int updateAudio() {
56+
mozzi_ns::AudioOutput updateAudio() {
5757
// shift back to STANDARD audio range, like /256 but faster
5858
return (aSin.next() * gain) >> 8;
5959
}

examples/examples-dsp/examples-mozzi/control_gain/control_gain.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void updateControl() {
4646
gain = gain - 3;
4747
}
4848

49-
int updateAudio() {
49+
mozzi_ns::AudioOutput updateAudio() {
5050
return (aSin.next() * gain) >>
5151
8; // shift back to STANDARD audio range, like /256 but faster
5252
}

examples/examples-stream/streams-generator-merge-pwm/streams-generator-merge-pwm.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SineWaveGenerator<int16_t> sineWave2(32000); // subclass of SoundGenerator with
1515
GeneratedSoundStream<int16_t> sound2(sineWave2); // Stream generated from sine wave
1616
InputMerge<int16_t> imerge;
1717
PWMAudioOutput pwm;
18-
StreamCopy copier(pwm, merge); // copy in to out
18+
StreamCopy copier(pwm, imerge); // copy in to out
1919

2020

2121
void setup() {

examples/tests/etc/test-tdm/test-tdm.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ InputMerge<int16_t> imerge; // merge to 8 channels
1212
DriverPins dac_pins;
1313
AudioBoard board(AudioDriverCS42448, dac_pins);
1414
AudioBoardStream tdm(board);
15-
StreamCopy copier(tdm, merge);
15+
StreamCopy copier(tdm, imerge);
1616

1717
// we use the AudioBoard API to set up the pins for the DAC
1818
void setupDACPins() {

src/AudioCodecs/AudioEncoded.h

+3
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ class EncodedAudioStream : public ReformatBaseStream {
382382
void setLogLevel(AudioLogger::LogLevel level) { enc_out.setLogLevel(level); }
383383
#endif
384384

385+
/// defines the size of the decoded frame in bytes
386+
void setFrameSize(int size) { enc_out.setFrameSize(size); }
387+
385388
protected:
386389
EncodedAudioOutput enc_out;
387390

src/AudioLibs/HLSStream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class URLLoaderHLS : public URLLoaderHLSBase {
104104
#if USE_TASK
105105
LockGuard lock_guard{mutex};
106106
#endif
107-
urls.push_back(str);
107+
urls.push_back((const char*)str);
108108
}
109109

110110
/// Provides the number of open urls which can be played. Refills them, when
@@ -255,7 +255,7 @@ class URLHistory {
255255
if (!found) {
256256
char *str = new char[url_str.length() + 1];
257257
memcpy(str, url, url_str.length() + 1);
258-
history.push_back(str);
258+
history.push_back((const char*)str);
259259
if (history.size() > 20) {
260260
delete (history[0]);
261261
history.pop_front();

src/AudioLibs/MozziStream.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11

2-
#include <MozziGuts.h>
32

43
#include "AudioTools.h"
54

5+
namespace mozzi_ns {
6+
#include <Mozzi.h>
7+
}
8+
69
void updateControl();
7-
int updateAudio();
10+
mozzi_ns::AudioOutput updateAudio();
811

912
namespace audio_tools {
1013

@@ -142,7 +145,7 @@ class MozziStream : public AudioStream, public VolumeSupport {
142145
}
143146

144147
// updateAudio() STANDARD mode is between -244 and 243 inclusive
145-
int result = updateAudio() * cfg.output_volume;
148+
auto result = updateAudio() * cfg.output_volume;
146149
// clip result
147150
if (result > 32767) result = 32767;
148151
if (result < -32768) result = -32768;

src/AudioTools/BaseStream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,13 @@ class DynamicMemoryStream : public BaseStream {
563563
SmoothTransition<T> clean_start(channels, true, false, factor);
564564
auto first = *list().begin();
565565
if (first!=nullptr){
566-
clean_start.convert(first->data,first->len);
566+
clean_start.convert(&(first->data[0]),first->len);
567567
}
568568

569569
SmoothTransition<T> clean_end(channels, false, true, factor);
570570
auto last = * (--(list().end()));
571571
if (last!=nullptr){
572-
clean_end.convert(last->data,last->len);
572+
clean_end.convert(&(last->data[0]),last->len);
573573
}
574574
}
575575

src/Communication/UDPStream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ class UDPStream : public BaseStream {
109109
/// Reads bytes using WiFi::readBytes
110110
size_t readBytes(uint8_t *data, size_t len) override {
111111
TRACED();
112-
size_t len = available();
112+
size_t avail = available();
113113
size_t bytes_read = 0;
114-
if (len > 0) {
114+
if (avail > 0) {
115115
// get the data now
116116
bytes_read = p_udp->readBytes((uint8_t *)data, len);
117117
}

0 commit comments

Comments
 (0)