Skip to content

Commit caad3fb

Browse files
committed
Copy buffer size
1 parent c3b58b0 commit caad3fb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

examples/sandbox/basic-a2dp-spdif/AudioConfigLocal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
#define I2S_BUFFER_COUNT 8
44
#define I2S_BUFFER_SIZE 256
5+
#define DEFAULT_BUFFER_SIZE 1536

examples/sandbox/streams-generator-spdif/AudioConfigLocal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
#define I2S_BUFFER_COUNT 8
44
#define I2S_BUFFER_SIZE 256
5-
#define DEFAULT_BUFFER_SIZE 32
5+
#define DEFAULT_BUFFER_SIZE 1536

src/AudioExperiments/AudioSPDIF.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class SPDFOutI2SESP32 : public SPDIFOut {
213213
bool end() { return i2s_driver_uninstall(I2S_NUM) == ESP_OK; }
214214

215215
size_t write(uint8_t *spdif_buf, size_t len) {
216-
size_t i2s_write_len;
216+
size_t i2s_write_len=0;
217217
i2s_write(I2S_NUM, spdif_buf, len, &i2s_write_len, portMAX_DELAY);
218218
return i2s_write_len;
219219
}
@@ -333,7 +333,7 @@ class SPDIFStream16Bit2Channels : public AudioStreamX {
333333
}
334334
}
335335

336-
return result / 2;
336+
return result / 4;
337337
}
338338

339339
protected:
@@ -402,6 +402,7 @@ class SPDIFStream : public AudioStreamX {
402402
#endif
403403
spdif.setOutput(spdif_out);
404404
}
405+
LOGI("SPDIF_BUF_SIZE=%d",SPDIF_BUF_SIZE);
405406

406407
// define source format
407408
converter.setInputInfo(cfg);

0 commit comments

Comments
 (0)