Embedding Mp3 files hosted elsewhere in my p5 sketch

So basically I am trying to get a project running on Wordpress that had two sound files in it. I’ve loaded the whole project folder into my c-panel and tried using a short code to run the project but the audio didn’t seem to want to talk to the rest of the sketch.

I don’t want to be too lengthy about this, but basically I am asking

When you have something like this ( taken from the p5 example page https://p5js.org/examples/sound-load-and-play-sound.html ):

function setup() {
song = loadSound(‘assets/lucky_dragons_-_power_melody.mp3’);
createCanvas(720, 200);
background(255, 0, 0);
}

Is it crazy to replace the 'assets/lucky_dragons_-_power_melody.mp3’ with something like ‘http://mydomainname/public_html/wp-content/uploads/processing-projects/ForMe.mp3’]

Or is that just never going to work…?

hi! @isasasa
yes we can replace (‘assets/lucky_dragons_-_power_melody.mp3’); with a proper location of mp3 file ,
like i have just tested the same with the link
https://archive.org/serve/testmp3testfile/mpthreetest.mp3
here is the link of sketch

As you can see , i have used preload function to load sound, it is done in case of large mp3 files must be loaded before they are used ! thus avoiding chances of errors .
also as i can see
http://mydomainname/public_html/wp-content/uploads/processing-projects/ForMe.mp3
is not working properly , so ensure you are using correct adress of mp3 file !!
and use preload function() too.

hope that will help !
let us know if the problem still persist !