Music streaming & Sounds from DFMOD

Discuss modding questions and implementation details.
Post Reply
User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Music streaming & Sounds from DFMOD

Post by King of Worms »

Im working on packing the Music score and Sounds to the two separate DFMOD packages

From what Ive gathered from the internet is, that the ideal LOAD TYPE setting for music is STREAMING
Its according to THIS, paragraph 4
https://paladinstudios.com/2012/07/30/4 ... nity-game/

It states the following:
These are our rules of thumb for optimal performance when it comes to different types of audio:

Short Clips – Native
Longer (or looping) clips – compressed in memory
Music – Stream from disc
Files which consistently cause CPU spikes – Decompress on load


Problem I face is the following:
With this settings, the music doesnt play after a 1st load?
You initialize the game to the base menu - no music
You load 1st save - no music
After 1st load (for example you enter the Inn from exterior) - music starts to play correctly and continues so for the rest of the gaming session

Any ideas why is it so?
Is "streaming" really the ideal setting for a music files?

Here is the unity manual section Audio
https://docs.unity3d.com/Manual/class-AudioClip.html

It describes this:
Decompress On Load
Audio files will be decompressed as soon as they are loaded. Use this option for smaller compressed sounds to avoid the performance overhead of decompressing on the fly. Be aware that decompressing Vorbis-encoded sounds on load will use about ten times more memory than keeping them compressed (for ADPCM encoding it’s about 3.5 times), so don’t use this option for large files.

Compressed In Memory
Keep sounds compressed in memory and decompress while playing. This option has a slight performance overhead (especially for Ogg/Vorbis compressed files) so only use it for bigger files where decompression on load would use a prohibitive amount of memory. The decompression is happening on the mixer thread and can be monitored in the “DSP CPU” section in the audio pane of the profiler
window.

Streaming
Decode sounds on the fly. This method uses a minimal amount of memory to buffer compressed data that is incrementally read from the disk and decoded on the fly. Note that decompression happens on the separate streaming thread whose CPU usage can be monitored in the “Streaming CPU” section in the audio pane of the profiler window. Note: Streaming clips has an overload of approximately 200KB, even if none of the audio data is loaded.


I USE THESE SETTINGS:

Music:
Load in background
Streaming
Preload audio data is not available for streaming
Music.jpg
Music.jpg (65.78 KiB) Viewed 1294 times
Sounds:
Load in background
Decompress on load
Preload audio data
Sound.jpg
Sound.jpg (74.15 KiB) Viewed 1294 times

ANY OPINIONS AND RECOMENDATIONS FOR A OPTIMAL PLAYBACK FROM A DFMOD?
Sounds work great with this setting.

THANK YOU!

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Music streaming & Sounds from DFMOD

Post by King of Worms »

Solved it anyway.. if someone faces problems like I did, just ask..

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: Music streaming & Sounds from DFMOD

Post by Interkarma »

Well done! You've really taken to getting assets packed within the Unity editor and solving problems. I was playing with DREAM the other day, and I'm impressed how far its come. DREAM looks better, loads faster, and is something like half the size (or less) of the original versions. Amazing work all around.

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Music streaming & Sounds from DFMOD

Post by King of Worms »

Thank you :) its my baby 😂

Post Reply