I am having problems loading a large sound file. It is too large to be uploaded directly to the P5js editor.
I have tried linking it to my dropbox, this has failed.
I have tried both load sound, and new p5.SoundFile (ensuring the index code has the library link included).
The drop box link is correct. My internet is running very fast. I have tried the code in both Chrome and Firefox. Both times it failed.
Code below-it is just to test getting a file loaded so very basic
type or paste code here
```let song;
// function preload(){
// song = loadSound('https://www.dropbox.com/preview/mySong.mp3');
// }
new p5.SoundFile('https://www.dropbox.com/preview/mySong.mp3')
function setup() {
createCanvas(720, 200);
background(255, 0, 0);
}
function mousePressed() {
if (song.isPlaying()) {
// .isPlaying() returns a boolean
song.stop();
background(255, 0, 0);
} else {
song.play();
background(0, 255, 0);
}
}
Help in solving this problem would be greatly appreciated!
That Dropbox URL (https://www.dropbox.com/preview/mySong.mp3) looks suspicious to me. URL:s for sharing contains some kind of user identifier usually. Looking like this:
You’re one step closer, at least. That URL points to a web page, not an mp3 file. What you want is probably: https://dl.dropboxusercontent.com/s/ei01e2vmt1f3pxi/mySong.mp3.