Skip to content

Commit aef7f71

Browse files
committed
I2Sstart() in Audio::Audio constructor leads to early crash #1062
1 parent 49ccce0 commit aef7f71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Audio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ esp_err_t Audio::I2Sstop() {
236236
}
237237
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
238238
void Audio::zeroI2Sbuff(){
239-
auto buff = audio_calloc<uint8_t>(128); // From IDF V5 there is no longer the zero_dma_buff() function.
239+
uint8_t buff[2] = {0, 0}; // From IDF V5 there is no longer the zero_dma_buff() function.
240240
size_t bytes_loaded = 0; // As a replacement, we write a small amount of zeros in the buffer and thus reset the entire buffer.
241-
i2s_channel_preload_data(m_i2s_tx_handle, buff.get(), 128, &bytes_loaded);
241+
i2s_channel_preload_data(m_i2s_tx_handle, buff, 2, &bytes_loaded);
242242
}
243243
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
244244

0 commit comments

Comments
 (0)