How to get your project to target Ogg-Vorbis

,

How to get your project to target Ogg-Vorbis

This article was originally written for UDN.

In some cases, particularly on consoles, it can be useful for debugging to target Ogg-Vorbis as your audio codec instead of the platform default. This article contains instructions for setting that up.

Note: While Unreal already has an implementation of OggVorbis available on most devices, there are a few where it does not. If you want to check for your specific platform, search for its associated AudioMixerDevice’s implementation of the function “CreateCompressedAudioInfo.” If it contains code referencing Ogg or FVorbisAudioInfo(), the steps below will be enough to get OggVorbis working for that device.

Step 1: Add the line
static FName NAME_OGG(TEXT("OGG"));

into the F[Platform]TargetPlatform::GetWaveFormat() function if it isn’t already present, and change the function’s return value to NAME_OGG. You can find this function in the file [Platform]TargetPlatform.cpp.

Step 2: In your platform’s Mixer Device implementation, change the return value of the FMixerPlatform[MixerModuleName]::GetRuntimeFormat() function to NAME_OGG, as well, again adding the line

static FName NAME_OGG(TEXT("OGG"));

if it is not already present. You can find the name of your platform’s Mixer Device implementation by looking at the field in your [Platform]Engine.ini file labeled “AudioMixerModuleName.”

Step 3: Recook your audio content.