You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using this library and encountered an issue during the process. I need to play multiple remote MP3 files continuously. Initially, I used connecttohost() to sequentially play the files as each file finished playing. However, because the next file is downloaded only after the current one finishes playing, there’s a significant delay between files, which makes the playback not very smooth.
So I tried a second approach: running two tasks. One task handles playback (using connecttoFS(SD_MMC)), and the other downloads the next audio file and saves it to the SD card, waiting for playback. However, a new issue arose—since both tasks access the SD card simultaneously (even though one is reading and the other is writing), occasional crashes occur when the File object is being read or written.
Then, I tried a third approach: again running two tasks, one for playback (using connecttoFS(SD_MMC)) and the other for downloading the next audio file. This time, instead of saving the file to the SD card, I stored the downloaded data in PSRAM. Before playback (i.e., before connecttoFS(SD_MMC)), the data in PSRAM is saved to the SD card. This avoids simultaneous read/write operations on the SD card. However, since the file must be completely saved before playback can start (saving takes around 500ms), there’s still a gap between MP3 files. Although this gap is within an acceptable range, it’s still not perfect.
Therefore, I was wondering if it’s possible to provide an API for directly playing raw data (e.g., connecttoRawData(uint8_t *data, size_t len)). This would eliminate the need to save data to the SD card (saving around 500ms), resulting in smoother playback.
Thank you for reading, and I look forward to your feedback.
The text was updated successfully, but these errors were encountered:
Hello, I am using this library and encountered an issue during the process. I need to play multiple remote MP3 files continuously. Initially, I used connecttohost() to sequentially play the files as each file finished playing. However, because the next file is downloaded only after the current one finishes playing, there’s a significant delay between files, which makes the playback not very smooth.
So I tried a second approach: running two tasks. One task handles playback (using connecttoFS(SD_MMC)), and the other downloads the next audio file and saves it to the SD card, waiting for playback. However, a new issue arose—since both tasks access the SD card simultaneously (even though one is reading and the other is writing), occasional crashes occur when the File object is being read or written.
Then, I tried a third approach: again running two tasks, one for playback (using connecttoFS(SD_MMC)) and the other for downloading the next audio file. This time, instead of saving the file to the SD card, I stored the downloaded data in PSRAM. Before playback (i.e., before connecttoFS(SD_MMC)), the data in PSRAM is saved to the SD card. This avoids simultaneous read/write operations on the SD card. However, since the file must be completely saved before playback can start (saving takes around 500ms), there’s still a gap between MP3 files. Although this gap is within an acceptable range, it’s still not perfect.
Therefore, I was wondering if it’s possible to provide an API for directly playing raw data (e.g., connecttoRawData(uint8_t *data, size_t len)). This would eliminate the need to save data to the SD card (saving around 500ms), resulting in smoother playback.
Thank you for reading, and I look forward to your feedback.
The text was updated successfully, but these errors were encountered: