Search public documentation:
- Audio System
- Common Concepts
- Importing Sounds
- Visual Editing Tools
- Optimising Sound Memory Usage
- Test maps
- Debug Commands
- Known Issues
- Platform Specifics
UnrealEngine3's audio system consists of a base audio class UAudioDevice. The base implementation takes care of some of the basic logic, such as adding and removing UAudioComponent objects. The UAudioComponent objects are content that can be played on the UAudioDevice. UAudioComponent objects contain USoundCue objects, which reference USoundNode objects which contain the actual audio data (i.e. a USoundNodeWave contains wave audio data). The platform specific portion of the UnrealEngine3's audio code lives in audio device classes derived from the UAudioDevice audio base class. Currently there are three platform specific audio devices: UALAudioDevice (OpenAL PC), UXeAudioDevice (XBox360) and UPS3AudioDevice (PlayStation3). All devices support an optional per source low pass filter, per bus reverb effects, per bus EQ filter and multichannel (4.0, 5.1, 6.1 and 7.1) sounds (when the hardware allows it). The intention is to have all platforms sounding as close as possible to each other. The base audio class implementation can be found in Engine\Src\UnAudio.cpp and the declaration in Engine\Inc\UnAudio.h. The base audio component implementation can be found in Engine\Src\UnAudio.cpp and the declaration in Engine\Inc\UnActorComponent.h.
- Init - Initialises the hardware, allocates channels and does any other work required to hear audio.
- TearDown - shuts down the hardware and frees all resources back to the system.
- Update - Updates the listener's position, orientation and velocity.
- Exec - Process any debug commands typed into the console.
- Init - Finds the sound asset to play and submits to the hardware.
- Update - Updates the Volume, Pitch, Location and Velocity from the engine to the hardware.
- Play - Starts a sound source playing.
- Stop - Stops a sound source playing.
- Pause - Pauses sound playback for this source.
- IsFinished - Handles a sound ending, sending notification as needed, and the double buffering of queued buffers.
- Init - Locate the sound resource and load it if necessary.
BITFIELD bUseOwnerLocation:1; // Spatialise this sound to the location of the actor this is attached to.
BITFIELD bAllowSpatialization:1; // Spatialise this sound in 3d space
FVector Location; // Location to use for spatialisation if not attached
FVector ComponentLocation; // Location to use for spatialisation if attached Using Ambient Zones page. DistanceModel Attenution page for more information.
- Identify Sound Group that causes ducking (dialog).
- When a sound from that group is triggered, other groups decrease in volume to desired amount (fade) over x time (
FadeStartTime= 0.3 seconds).
- Amount other groups decrease in volume (
- When sound from ducking group stops, other groups increase in volume back to normal volume (fade) over x time (
FadeStopTime= 0.2 seconds).
- May also want sound group exceptions to the ducking process (e.g. music), or a sound group called Exceptions that isn't affected.
The engine currently supports importing uncompressed little endian 16 bit wave files at any sample rate (although sample rates of 44100 Hz or 22050 Hz are recommended).
|Speaker Channels||Mono, Stereo, 2.1, 4.1, 5.1 6.1, 7.1|
|BackLeft||_bl||*||*||If there is no BackRight channel, this is the BackCenter channel|
Sound Cue Editor. Generic Browser and select Sound Quality Previewer, the engine will compress the sound at 5, 10, 15, 20, 15, 30, 35, 40, 50, and 60 compression settings. You can then click on any given quality settings and hear the sound after it has been re expanded back to 16 bit PCM. This can be used to select the best fidelity vs memory setting. Clicking OK will apply the currently selected setting to the wave. Generic Browser... To import:
- Select Import from the menu.
- Select the files "Surround_fl.wav", "Surround_fr.wav", "Surround_sl.wav", "Surround_sr.wav".
- Select the package you wish to save to and click OK to all.
- Select Export from the menu.
- Pick a location to save the files to.
Regarding loudest potential volume, there's a bit more overall bandwidth to work with. For example, a stereo file at 1.0 volume will be 2x louder than a mono file, likewise (4) mono files would be 4x louder. But eventually you'll hit the overall threshold and the output will begin to clip and distort. On any given sound cue, volume settings up to ~2.0 will increase the perceived loudness of the audio file, anything above that won't. A single cue will never distort, but you won't want all of your files at max volume because it'll likely overload when multiple cues play simultaneously in-game. You may want to consider coming up with a consistent volume scheme, or at least some general guidelines for your volumes:
When authoring content, it's best to use the lowest sample rate that maintains audio fidelity. All sample rates are supported for all platforms. For example, dialog generally still sounds good at 22.1kHz, whereas commonly played effects with high frequencies (such as gunshots) need to be higher (e.g. 40.0kHz). A similar heuristic can be applied to the quality setting. Formerly, the distance crossfade node was used to apply a low pass filter for sounds at distance (the dry sound was mixed with a low pass filtered version of the same sound). However, all platforms now support attenuation with a low pass filter meaning the filtered version of the sound is no longer required.
UTGame has several test maps for verifying audio system functionality -
- DM-SoundLoop - to test infinitely looping and loop with notification sounds.
- DM-SoundReverb - to test reverb and attenuation with a low pass filter.
- DM-SoundMultichannel - to test 5.1 playback.
- DM-SoundMode - to test sound modes. Available test modes are loud, quiet, quick, slow, lowpass, bandpass, highpass.
- DM-SoundInterior - to test the ambient zone functionality.
The Unreal Engine Audio System does not support simultaneous streaming of arbitrary audio content, only the streaming of packages that contain audio. This approach was favored because we wanted to devote as much bandwidth to texture streaming as possible; and having a delay for such fast action games as Unreal Tournament and Gears of War would also be unacceptable, and syncing up the FaceFX anims becomes an additional chore at this point. As an alternative, a special dialog system was created for Gears.
- ResetSoundState: turns off any and all debug commands.
- TestLowPassFilter: applies a low pass filter to all sources.
- IsolateDryAudio: filters out the reverb sounds leaving only unreverbed sounds.
- IsolateReverb: filters out the dry source leaving only the reverb sounds.
- SetSoundMode x: applies volume and pitch modifications from the sound group properties, and applies an EQ filter from a table defined in UnAudioEffects.cpp.
- ListSounds, ListSoundDurations, ListAudioComponents: list details of the currently loaded sounds.
- ListWaves: list the details of the currently playing sounds.
- TTP 60174: Audio will start over when gameplay window is moved.
- TTP 64605: -nosound does not propagate to PIE
- TTP 80463: AmbientSoundSimple actors don’t always restart in real-time preview in Editor
- TTP 92710: Sound Cues using the Delay Node don't preview correctly in generic browser or sound cue editor
- TTP 120345: AmbientSoundSimpleToggleable volume fading is broken
- TTP 122495: Looping Node doesn't work if placed after the mixer when non looping nodes are also connected
- TTP 122683: Distance Crossfade node incorrectly retriggers SoundNodeWave playback