Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 184c385

Browse files
fpistmalfran
authored andcommitted
Fix Audio player issue.
Wrong Audo.begin preBufferSize (default 1024). As write gave a buffer of 1024 nothing was written. Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent 497b341 commit 184c385

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

libraries/Audio/example/SimpleAudioPlayer/SimpleAudioPlayer.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ void loop() {
4949
WAVE_FormatTypeDef WaveFormat;
5050
const int S = 1024; // Number of samples to read in block
5151
uint32_t buffer[S];
52-
int duration;
5352
delay(1000); // delay for console
5453

5554
File myFile = SD.open(recFile);
@@ -68,7 +67,7 @@ void loop() {
6867
delay(1000);
6968
SerialUSB.println("Starting Playback");
7069
delay(1000);
71-
Audio.begin(WaveFormat.SampleRate, 100);
70+
Audio.begin(WaveFormat.SampleRate);
7271

7372
delay(1000);
7473

libraries/Audio/src/Audio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ size_t AudioClass::write(const uint32_t *data, size_t size) {
140140
if (!audio_out_init) return 0;
141141

142142
if (size > (bufferOutSize / 2))
143-
return size;
143+
return 0;
144144

145145
/* Not running yet, need to fill-in full FIFO */
146146
if (running == NULL) {

0 commit comments

Comments
 (0)