Download an MP3 file

I am brand new to XOJO and trying to determine how to go about writing an app (to eventually be used on a Raspberry Pi) which downloads an MP3 file from a specific URL (in the form of http://www.myserver.com/podcast/myaudiofile.mp3) and then later (at a specific time/date and without any user intervention) plays that file. The Web AudioPlayer in the Examples folder nearly does what I need and would provide a great start to get me up and running quickly, but there is no “Play” property for this control so I cannot seem to commence playback under program control.

I am thinking that I may need to do this in two steps: 1: Download the mp3 file and save it to disk; then 2: Sit in a loop until the right time to begin playback then point the player at the saved MP3 file.

If anyone can offer any suggestions or advise on how to proceed this I’d be most obliged.

Incidentally, how DO you pronounce XOJO ?

Many thanks,
Ralph, (Melbourne/AUS)

EDIT: I should add that I am only using the trial version of XOJO at this stage.

1 - See http://documentation.xojo.com/index.php/HTTPSocket
2 - A loop is an obsolete way of doing what you want. It will freeze the app. The right way to do that is to use a timer. If you already know the play time, you can use a single timer that will work like an alarm clock, or if you are waiting for a condition, use a multiple timer that checks for that condition.

http://documentation.xojo.com/index.php/timer

Listen to the latest podcast for the pronounciation at XojoTalk 023 – Take a Walk – Xojo Programming Blog

Thanks Michel. I will check out those links and I appreciate your fast reply and advise.

Warm regards,
Ralph

Welcome to Xojo :slight_smile: