Audio settings for Dialogue?

Which Load Type and Compression Format settings give the best performance for dialogue audio files that range from 10-30 seconds long? Is Decompress on Load or Compressed in Memory better for this audio file length? Which is the best compression format setting? Currently I use Decompress on Load and PCM, which is causing occasional audio stuttering/repeating and crackling occasionally. Was wondering if this performance issue was related to the audio import settings, any guidance would be great! The info online doesnt really explain what to do for this specific type of audio length. There are two characters that will play these dialogue sounds at different times from a 3d audio source, with the player then making single key press text based replies on screen to prompt the next audio dialogue to play. Imagine a skyrim/fallout based npc story interaction. So about 5-10 audio dialogues will play one after the other, if that is at all relevant.

I have to bump this

Hi @rmele091

The kind of crackling/stuttering you mention is probably more related to your project audio settings. I’d recommend you try setting the value of DSP Buffer Size (Edit > Project Settings > Audio) to Best Performance.

The format of the AudioClip should not really affect the quality of the playback. It will impact…

  • the size of your audio files in the game build
  • the time it takes to make it playable by an AudioSource
  • the quality of the sound in your game

About loading…

Decompress on Load will make your game reach for the sound in you build data when a scene gets loaded.
Compressed in Memory will be lazy, and only try to get the sound in the build data when it’s requested to play.
Both of these will load the sound completely before making it playable for an AudioSource.
Streaming is going to be lazy like the above, but will make the sound playable faster, because it will provide its data chunk by chunk to the AudioSource, thus trading memory footprint for CPU.

For dialogue, I think streaming is the best choice, as it will load audio as it’s needed and you won’t waste space if you don’t get to the end of the file. Decompress on Load would probably be the worst choice, because you would load everything up front and use memory for every dialogue sound. This would be quite wasteful, especially if you have a lot of dialogue permuations possible, because of a conversation tree or multiple languages.

About compression…

  • PCM is basically the raw sound, no compression. That’s useful for quick loading and precise seeking, but it’s the biggest is terms of size.
  • ADPCM will get you smaller files, fast decompression speed but lesser quality
  • Vorbis is a great compromise, good size compression, as it’s slightly slower than the ADPCM to decompress but has a better audio quality.

I hope this helps!
Cheers