Preloading sounds

Creating scripts
Post Reply
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Preloading sounds

Post by Graham Mills »

I've been experimenting with sliced wav files to deliver speech, not an area I've explored previously. I'm a little dubious about it as it does generate a lot of extra heat in my laptop. However, I wonder whether I am using the ability to preload sounds properly. Is it sufficient to execute llPreLoadSound once, e.g. when the region starts, or does it need to be invoked every time an avatar comes in range (what I'm doing at present)?
User avatar
Handy Low
Posts: 231
Joined: Fri Nov 08, 2013 3:38 pm
Location: Yorkshire, England
Has thanked: 207 times
Been thanked: 140 times
Contact:

Re: Preloading sounds

Post by Handy Low »

I would preload the sounds whenever a new avatar arrives in the region, even if they've visited the region previously. If you do that, then you've theoretically ensured that everyone has the sound cached.

You don't need to take region restarts into account, nor need you worry about the distance between the avatar and the object - all sounds in a region are cached.
These users thanked the author Handy Low for the post:
Graham Mills
Handy Low
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1142 times

Re: Preloading sounds

Post by Graham Mills »

Thanks, Handy. There are a rather a lot of wav files so that would be a little bandwidth-intensive, especially if a group arrived all at the same time. My understanding was that preload only works on those avatars within listening range. At the moment I'm preloading alternately with playing which does cause stutter until sounds are called from cache. Fortunately the build is fairly linear so I guess I could try preloading a batch of sound clips at intervals when the avatars are unlikely to be playing (playback is controlled by the avatars). I don't have any hard evidence but, as you imply, my guess would be that the sounds aren't recalled from cache in the long term. Stutter is back again next day.

What I am aiming for, incidentally, is a Rift-friendly experience that communicates information without resort to notecards. Textures/slideshows are another possibility with the bonus that they also play nicely with Lumiya.
Handy Low wrote:I would preload the sounds whenever a new avatar arrives in the region, even if they've visited the region previously. If you do that, then you've theoretically ensured that everyone has the sound cached.

You don't need to take region restarts into account, nor need you worry about the distance between the avatar and the object - all sounds in a region are cached.
These users thanked the author Graham Mills for the post:
Handy Low
User avatar
Handy Low
Posts: 231
Joined: Fri Nov 08, 2013 3:38 pm
Location: Yorkshire, England
Has thanked: 207 times
Been thanked: 140 times
Contact:

Re: Preloading sounds

Post by Handy Low »

Things may have changed since I last investigated sound caching, a few years ago now I come to think of it.

Also, if sound caching logic is as flawed as texture and object caching logic, then all attempts to predict it are doomed.
These users thanked the author Handy Low for the post:
Ozwell Wayfarer
Handy Low
Post Reply