I want to upload music to play in the background of my game, but the file is too big. It says I have the option to post an URL, but youtube or dropbox don’t work. Is there a site that works with code.org where it will play the sound file that is linked?
The key to doing this is that the link has to be a direct URL (ie. it should end in .mp3). This rules out most of the popular file storage sites as they don’t give you direct links.
I was able to get it to work using a free file hosting site called “Open Drive”.
Here’s a link to information on OpenDrive.
It’s the Direct link: (streaming) link that worked for me.
Mike
@mwood ,
Thanks for reaching out. I did make an open drive account, upload the audio file, and put it in my game. But it still won’t play. Is there a specific I need to have when uploading the audio file to open drive? Like a specific folder?
Here is my game if you think it’s a code problem: Code.org - Game Lab
The part with the background music is under my variables and under the comment “music”
Well darn … not sure what’s going on, then. When I copy your URL and paste it into a browser, the music plays just fine.
For mine, I put it in the Music folder on OpenDrive (as in the image below).
However, I took one of my longer (larger) files and tried to put that in the playSound block on my project and it wouldn’t play. It is possible that GameLab won’t play the larger or longer mp3 files even if they are hosted elsewhere. Not sure if there is an easy fix for that … maybe you just need a shorter piece of music that loops.
I’ll pass it on to code.org to see if they are aware of any limitations. It could just be a limitation of GameLab.
Mike