Loading WAV files on the fly

It would be super awesome if the audio system had a way to import WAV files (or any other commonly supported audio file) on the fly. Currently its possible to do this for image files - with a bit of glue code I can download png files from the internet and display in game - but I haven’t managed to do this for audio for any standalone build.

It looks like it might be possible to do it on desktop platforms using the Ogg vorbis importer, but not mobile. I haven’t actually tried the ogg approach as my main target is mobile.

Check out Rama’s BP library, it has some nodes for loading WAVs and OGGs from disk.

Do you have a link? I’ve found information by Rama and others but nothing I’ve found so far will work on mobile.

The wave file loading I’ve found involves code a bit like that that I’ve posted below, but when you try this in a standalone build it fails (when playing the sound, not loading) expecting ogg vorbis format.

    USoundWave* sw = NewObject<USoundWave>(USoundWave::StaticClass());
    FFileHelper::LoadFileToArray(rawFile, *fullName);
FWaveModInfo WaveInfo;
if (WaveInfo.ReadWaveInfo(rawFile.GetData(), rawFile.Num()))
    .. construct sw's header from WaveInfo

The ogg vorbis code (for instance FVorbisAudioInfo) seems to be compiled as desktop only.

I’ve actually got downloaded WAV files playing nicely on MAC and PC, but no joy on iphone.