Reference External Audio File

For my first Oculus Project I am creating a VR sing along to the Let It Go song for my niece, and I was thinking it would be great to send out to all the geek dads so they can get their kids excited about VR too. However, I don’t think I could widely distribute with the music already in. So I was going to have people buy the mp3 here (http://www.amazon.com/Let-It-Go/dp/B00GLQQ24A) then convert it to a useable file here (http://www.online-convert.com/). Once it is a wav or OGG file I am still at a lose as to how to get the game to reference and play the external audio file.

I am sure there has to be a way. Thank you in advance for your help!

I’m afraid there isn’t an easily available method of doing this, certainly not without writing extra code, all of our code for importing sounds is tied into the editor. I’ve previously suggested a method but I’m not sure if the user had any success, since our internal format is OGG you might be able to load an ogg file as an array of bytes and then plug that into an existing SoundWave so that it thinks that the ogg data has been loaded. If you look into where CompressedFormatData in SoundWave is used you might be able to make some progress.

You could also perhaps try out our MOD file support if you can find a recreation of it that you’d be able to use :wink:

Thanks Matt, I was thinking of a possible work around where I tell people to download the MP3 and put it in a directory. Then I just check to make sure that the file is present. If the file is present the I can play the .uasset audio file. It would have the same affect with less technical hurdles.

Do you know of a way of pinging an external file to see if it is there? Then report back a boolean value I can tap into?

Thanks again for your help with this!

I’m not exactly sure I can speak to the legality of that approach, as you’d still technically be distributing copyrighted material. Our internal utility function for checking whether a file exists is FPaths::FileExists.

Thanks for your help! It is good to know the options.

I came through here looking for an answer to this problem in 13.2 and figured out a way using your idea for pointing to a fake file of sorts.

After setting up your media playlist with that tutorial, rename any mp3 to something easy to remember like 1.mp3 and move it to C:\YourProgramMusic\1.mp3

Then right click the content browser and chose Media>>File Media Source then open that new file. Under File>>File Path point to your 1.mp3. If the playlist you created in the above tutorial only contains that File Media Source, once inside your packaged program, it will play whatever 1.mp3 it finds when you press 2, (assuming your users have an available C: drive).