Dev build/Linux: modded SoundClips not preloaded [RESOLVED]

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Dev build/Linux: modded SoundClips not preloaded

Post by TheLacus »

pango wrote: Sat Nov 10, 2018 11:59 am GetAudioClip(true, true) does the job without the need for an explicit coroutine:
It's not the same thing: the boolean flag is for streaming instead of uploading eveything to ram before playing. I would consider it only for the background music, i think streaming all sound effects would increase cpu overhead without any benefits.
If it avoid the issue you reported it might deserve some tests with a profiler, though.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Dev build/Linux: modded SoundClips not preloaded

Post by pango »

TheLacus wrote: Sat Nov 10, 2018 1:19 pm It's not the same thing: the boolean flag is for streaming instead of uploading eveything to ram before playing. I would consider it only for the background music, i think streaming all sound effects would increase cpu overhead without any benefits.
From what I'm reading, the audio clip is also automatically unloaded when done playing, not good.
And LoadInBackground seems to have been obsoleted, damn.

What about wrapping calls to AudioSource.PlayOneShot() with a coroutine that waits for the clip to be loaded, like this:
https://github.com/Interkarma/daggerfal ... -from-file
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: Dev build/Linux: modded SoundClips not preloaded

Post by pango »

I created a PR so this can be reviewed.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Dev build/Linux: modded SoundClips not preloaded

Post by TheLacus »

Thank you. I'll try it and review asap.

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

Re: Dev build/Linux: modded SoundClips not preloaded

Post by Interkarma »

A fix for this has now been merged, thanks to pango/petchema!

Locked