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
1.99k stars 433 forks source link

Locate position in flac file #633

Closed liuleih2023 closed 1 year ago

liuleih2023 commented 1 year ago

First of all,thanks for Philhower very much for amazing audio Lib.

Recently I am making a Bluetooth player, I also hope to play music files(flac & mp3) from SD card, decode them through ESP32, and then output them to DACs through I2S.

Share a little information I found: ESP32's CPU is not powerful enough, and when ESP32 plays high compression ratio FLAC files, there will be a lot of stuttering. Sound like "KaKaka" in music stream. I found that re-encoding FLAC files and choosing "fastest decoding mode" for FLAC files has very good playback quality, at the cost of larger file size. TF card needs to be a high-speed card, and the clock frequency of SPI needs to be adjusted, So TF card is not a bottleneck.Although I have not tested the situation when the ESP8266Audio and TFT display function etc. work at the same time.

But I have a question, I want to be able to play cue files, so that it needs to be located in the FLAC file, can this tool allow me to locate position in flac file?

I tried "SEEK()" ,but it doesn't work...

      decoder->begin(SDsource, I2Sout);
      SDsource->seek(40000,0);

And what should I do?

Thanks again.

.

屏幕截图 2023-06-02 151549 屏幕截图 2023-06-02 151809
liuleih2023 commented 1 year ago

got it!