Solved Audio AssetBundles better than linked MP3?

VamMoose

Well-known member
Messages
263
Reactions
358
Points
63
I have various music used in my scenes. They obviously add quite a lot of load time that has become noticeable.

So I have 2 questions.

1) Are assetbundles better for loading assets, particularly audio in terms of efficiency, compression, loading time, etc?

2) Can Audio within asset bundles be affected by audio source affecting plugins, such as @hazmhox VamAtmosphere or @MacGruber Audio Reverb or @Sally Whitemane 's SSFX?
 
Last edited:
Solution
Some context for other readers who might stumble into this thread:
AssetBundles containing audio files can be played with LogicBricks. Check SoundFromAB and RandomSoundFromAB bricks.

1) Are assetbundles better for loading assets, particularly audio in terms of efficiency, compression, loading time, etc?
Yes. When loading regular audio it has to be processed and converted into Unity's internal formats. When loading from AssetBundle you have that instantly, so it's just loading the actual data from disk. However, loading from a single large file is also faster than lots of small files, especially on HDD. I think the speed difference in loading from SSD...
Some context for other readers who might stumble into this thread:
AssetBundles containing audio files can be played with LogicBricks. Check SoundFromAB and RandomSoundFromAB bricks.

1) Are assetbundles better for loading assets, particularly audio in terms of efficiency, compression, loading time, etc?
Yes. When loading regular audio it has to be processed and converted into Unity's internal formats. When loading from AssetBundle you have that instantly, so it's just loading the actual data from disk. However, loading from a single large file is also faster than lots of small files, especially on HDD. I think the speed difference in loading from SSD is somewhere around a factor 50-100x? @Slam Thunderhide might have better numbers as he works on a scene with thousands of audio files. With my Life plugin, which comes with 177 mostly short audio files, the the load time went from "more than a minute" to "less than a second". When you have more than just a few audio files, AssetBundles are really the only way to go.

However, when making the AssetBundle make sure to choose the proper import settings for your Audio. Especially check "Load Type" and "Compression Format" settings appropriate for your audio:

2) Can Audio within asset bundles be affected by audio source affecting plugins, such as @hazmhox VamAtmosphere or @MacGruber Audio Reverb or @Sally Whitemane 's SSFX?
There should be no difference. All apply to both.
 
Upvote 0
Solution
Some context for other readers who might stumble into this thread:
AssetBundles containing audio files can be played with LogicBricks. Check SoundFromAB and RandomSoundFromAB bricks.


Yes. When loading regular audio it has to be processed and converted into Unity's internal formats. When loading from AssetBundle you have that instantly, so it's just loading the actual data from disk. However, loading from a single large file is also faster than lots of small files, especially on HDD. I think the speed difference in loading from SSD is somewhere around a factor 50-100x? @Slam Thunderhide might have better numbers as he works on a scene with thousands of audio files. With my Life plugin, which comes with 177 mostly short audio files, the the load time went from "more than a minute" to "less than a second". When you have more than just a few audio files, AssetBundles are really the only way to go.

However, when making the AssetBundle make sure to choose the proper import settings for your Audio. Especially check "Load Type" and "Compression Format" settings appropriate for your audio:


There should be no difference. All apply to both.
I don't have accurate numbers but I concur with MacGruber that load time for almost 2000 sound files goes from minutes to seconds. It's a game changer. The interface in Logic Bricks 14 for ABs is a massive help when working with lots of sound files. AB's also seem to compress the file size compared with the loose mp3s which is also a plus.
 
Upvote 0
I am about to bundle my Audio, do you guys have any recommended compression settings I that might be best for VAM or are the defaults already a pretty big gain?

From what I can search online the answer is....it depends (Sourced below)

I will quote a snippit from one of the articles

  • PCM is lossless compression and, while light on the CPU, has a much larger file size
  • ADPCM has a fixed compression ratio of about 3.5 and, while a good compromise between PCM and Vorbis/MP3, can sometimes cause unwanted noise (quantization distortion) in audio files with lots of high-frequency content
  • Vorbis is a very efficient audio codec that offers high-quality lossy compression but requires more CPU resources for decompression
  • MP3 also offers high-quality lossy compression but causes problems for audio assets that should loop

Does this still ring true within VAM, or is there an unspoken guideline within the VAM creation space?

Source: https://www.gamedeveloper.com/progr...-compression-mode-for-your-addressable-groups

Source: https://medium.com/@made-indrayana/understanding-audio-compression-settings-in-unity-e879a821023f
 
Last edited:
Upvote 0
I am about to bundle my Audio, do you guys have any recommended compression settings I that might be best for VAM or are the defaults already a pretty big gain?

From what I can search online the answer is....it depends (Sourced below)

I will quote a snippit from one of the articles



Does this still ring true within VAM, or is there an unspoken guideline within the VAM creation space?

Source: https://www.gamedeveloper.com/progr...-compression-mode-for-your-addressable-groups

Source: https://medium.com/@made-indrayana/understanding-audio-compression-settings-in-unity-e879a821023f
I just followed MacGruber's walk through PDF to the letter.
 
Upvote 0
Upvote 0
Back
Top Bottom