Skip to content

Playing URLS from list on a SD Card #1735

Answered by pschatzmann
waszee asked this question in Q&A
Discussion options

You must be logged in to vote

The current AudioSourceURL implementation is designed to store a big amount of urls in PROGMEM w/o impacting the available RAM.

My recommendation would be to do something like this:

  • create your own subclass of AudioSourceURL
  • In your constructor open and read your file in order to count the records and update the max variable.
  • in your destructor you close the file
  • overwrite the following method with your own logic: virtual const char* value(int pos)
    Read your file from the beginning until the requested index and return the string at the requested position.
    keep the last index and result in some variables, so that you can return them quickly when they are requested multiple times

This has…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@waszee
Comment options

@waszee
Comment options

Answer selected by pschatzmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants