Storing an audio file offline

Hi,

I’m looking to create an audio player which (when the user first accesses) streams an audio file from a URL. They then have the option to download it to the local device (so for future listens they don’t use any data). I would have assumed this would be the “LocalDB” component, but this is only for simple info so is unlikely to work for an audio file. It was suggested to store it as a stored variable, but I think this just stores the URL of the audio file rather than the audio file itself.

Is anyone able to clarify how I can go about doing this or if the functionality is within Thunkable to do this?

Much appreciated!

Hi,

The ability to save files locally in Thunkable X is not. But you can try to do this:

  1. get the file url
  2. using the service http://api.foxtools.ru/v2/Help/Base64 convert it to text base64 format
  3. save the resulting string to the local storage
  4. get the string from the repository and play it through the WebViewer.

Maybe a newbie q, but when playing this through the web-viewer, would it need to be connected to the internet?

If you have saved data in the local storage, then an internet connection is not required.