Optimize AudioClip Settings

How to optimize the settings of your AudioClips to use less RAM and CPU

Here are some settings you’d want for most games get lower RAM usage, disk read and CPU usage. Read more about the other settings here: Unity Manual - AudioCliparrow-up-right.

AudioClip - Overall Settings

Compression Format: Vorbis Quality: 60. Which is ~192 kbit/s for Vorbis. You can go lower if you’d want to save space but it comes at a loss of quality. Sample Rate Setting: Should be the same as the sample rate of the platform, which today mostly is 48kHz (this is so that it doesnt have to do a sample rate conversion) when playing. Also, if the sounds are created in 48kHz there is more high frequency content which makes it sound better when pitching down vs 44.1kHz.

circle-info

❕ Tip: If you select multiple AudioClips, you can see their total “Imported Size” which is the size they’ll have after all your format and quality settings are applied.

AudioClip - Vorbis Quality

Unity Vorbis Quality 1 is VBR Quality 0 (not -2). Mono is half the bitrate of stereo and 4 channel files (for surround) are twice the bitrate of stereo.

Unity Vorbis Quality

VBR Target kbit/s stereo

VBR Target kbit/s mono

VBR Range kbit/s stereo

Noise Test kbit/s stereo

Size vs 10

Size vs 60

Comment

100

500

250

500 - 1000

554

100%

260%

Uneccessarely big, don’t use this

90

320

160

320 - 500

435

64%

167%

Uneccessarely big

80

256

128

256 - 320

382

51%

133%

Use if you want to mazimize quality & have the disk space and RAM

70

224

112

224 - 256

309

45%

117%

60

192

96

192 - 224

232

38%

100%

Use this as a default, it is a good balance between quality and size

40

128

64

128 - 160

128

26%

67%

20

96

48

96 - 112

102

19%

50%

10

80

40

80 - 96

87

16%

42%

Sounds acceptable. Use if you are desparate for saving space and RAM

1

64

32

64 - 80

71

13%

33%

Looses a lot of quality, noticeably stereo separation and bass

Notes: Noise test is calculated using VBR export & size comparison to CBR with a known bitrate. Sources: Recommended Encoder Settingsarrow-up-right and Vorbis Qualityarrow-up-right. The bitrates are approximate.

AudioClip - Load Type

Stereo files are double the size of mono files. So a 60s 2 channel sound is the same size as a 120s 1 channel sound. The lengths are approximated with stereo files in mind.

Length Seconds ~

Play Frequency

Load Type

Pros

Cons

Example Sounds

Short - Less than 1s

High

Decompress On Load

Uses less CPU

Uses 10x RAM so only use for short sounds.

Player sounds, footsteps, impacts etc. Commonly used for mobile platforms

Short - Less than 1s

Low

Compressed In Memory

Uses less RAM

Medium - More than 1s less than 60s

High & Low

Compressed In Memory

Uses less RAM

Long - More than 60s

High

Compressed In Memory

Uses less disk read

Try if you have problems with audio delays. Watch out for load times and RAM usage

Localized 3D ambiences etc

Long - More than 60s

Low

Streaming

Uses less RAM

Many platforms can only handle less than 10 simultaneously streaming sounds

Music, background 2D ambiences etc

Note: You want to stream the largest files you have, but not too many at the same time. So the 60s threshold for long sounds can be lowered to e.g. 30s or even lower if not many sounds are +60s.

AudioClip - Preload Audio Data Makes the sound load at startup, which might create long load times on harddrives and slower systems. Is useful to combine with Load In Background so it doesn’t interrupt the main thread.

Length in seconds

Play Frequency

Preload Audio Data

Pros

Cons

Example Sounds

Short - Less than 1s

High

Yes

Less frequent disk read

Use only for frequent & short sounds. Combine with Load in Background

Player sounds, footsteps, impacts etc

Short - Less than 1s

Low

No

Medium & Long - More than 1s

Low

No

Note: I’ve had problems where if I don’t Preload Audio Data, there might be clicks heard in the end of sounds. "Prevent End Clicks" in the SoundContainer mitigates this.

AudioClip - Load In Background When enabled, the AudioClip is loaded without stalling the main thread and any playing is delayed until the AudioClip is loaded. Useful to combine with Preload Audio Data so it doesn’t interrupt the main thread.

Last updated