earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.01k stars 432 forks source link

read data from AudioFile #550

Open masm31 opened 2 years ago

masm31 commented 2 years ago

I have built an http server on android, and could connect to ESP8266 and get an audio file from android and play it on ESP8266 wav and mp3. But I want to use PCM data to send over a UART, how can I do it? I have used this code to send the PCM data, But it would only send 1 packet, it would not send the second packet

`

filehttp = new AudioFileSourceHTTPStream((char )hostName); buff = new AudioFileSourceBuffer(filehttp, 4096); uint8_t buff2; uint32_t sizeBuff2 = 2000; buff2 = (uint8_t )malloc(sizeof(uint8_t) sizeBuff2); uint32_t len = buff->read(buff2 , sizeBuff2); Serial.write(buff2,sizeBuff2);

  `