Dynamic URL #1535
-
How to make dynamic url audio source? all examples is using constant variable and run it in setup() with url.begin() function, correct me if i'm wrong. But, the point is how to use dynamic url in the sketch because i want to change the url based on API data and how to run url.begin() on loop(), it is possible or not? if it possible please teach me. Sorry for my bad English. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Did you look at the class documentation ? There is nothing which would prevent to call begin just whenever if make sense. Just don't forget to call end() if you already have called begin() before. |
Beta Was this translation helpful? Give feedback.
-
Not without knowing what you want to do! |
Beta Was this translation helpful? Give feedback.
-
You need to work on your communication skills ! Your API does not mean anything to me. Is it something that already exists ? What is the functionality, what is the data representation ? You need to decide how and where you want to store your URLs. It could be in the limited RAM or it could be in PROGMEM. I suggest that you have a look at the AudioPlayer with the corresponding AudioSourceURL that uses an array of C strings in the constructor which are stored in PROGMEM when you define them as const. Here is the related example for an AudioKit |
Beta Was this translation helpful? Give feedback.
Did you look at the class documentation ?
There is nothing which would prevent to call begin just whenever if make sense. Just don't forget to call end() if you already have called begin() before.