ID:154975
 
I've been wondering if this is possible. Right now I have an .ogg file(about 5mb) that plays when the player gets into a fight. The first time it plays during the session, it freezes the game for about 2-3 seconds, then the rest of the time it it plays instantly. I close dreamseeker and run the game again, and it has to go through the same procedure of loading the .ogg the first time, and not having to the rest of the time.

What I want is for the player to only have to run the .ogg the first time they open the game, then from there on, it plays instantly.

I don't understand how it has to reload every session? I'm guessing it's loading as a temporary resource and gets removed when the session is closed?
Use the browse_rsc() proc.
In response to Raimo
Raimo wrote:
Use the browse_rsc() proc.

Hm, could you provide a small example of how this works with a sound file? I tried, but no avail.

Here's what I tried:
src << browse_rsc(BattleTheme,"Battle")
src << browse("Battle")

var
BattleTheme='Battle.ogg'
In response to AbdelJN
src << browse_rsc(BattleTheme,"Battle.ogg")
In response to Raimo
Raimo wrote:
> src << browse_rsc(BattleTheme,"Battle.ogg")
>


How would I play it?

I attempted both

usr<<sound("Battle.ogg",1,0,1)


and

usr<<browse("Battle.ogg")
In response to Raimo
Forget what I did there.

src << browse_rsc('Battle.ogg')
src << browse('Battle.ogg')
In response to AbdelJN
I replied again, check the post above yours.
In response to Raimo
Raimo wrote:
Forget what I did there.

> src << browse_rsc('Battle.ogg')
> src << browse('Battle.ogg')
>


When I tried this, nothing happened. Music didn't play :/.
In response to AbdelJN
AbdelJN wrote:
Raimo wrote:
Forget what I did there.

> > src << browse_rsc('Battle.ogg')
> > src << browse('Battle.ogg')
> >

When I tried this, nothing happened. Music didn't play :/.

src << browse_rsc('Battle.ogg')
src << sound('Battle.ogg')


Seems like I'm having brain failures.
In response to Raimo
Ahaha it's all good.

I tried this, but it's giving the same results I started with. It still causes a pause in the game for the first time it loads during each session.
In response to AbdelJN
Weird, try to call the browse_rsc on client/New().
In response to Raimo
Raimo wrote:
Weird, try to call the browse_rsc on client/New().

Same results-__-, I'm starting to doubt if this is even possible.
In response to AbdelJN
you can try the pause setting in sound.status, and pause it until it's needed, unsure whether or not that'll just resend the sound to the player

you can try saving the sound() to a variable and sending it to the player when needed, so it wouldnt have to be initialized when you want it to be played

theres also a SOUND_STREAM setting in sound.status that makes the sounds load up faster, but i believe it impacts quality

i dont really have anything to test it out on, so im just giving you suggestions to the things i thought of
good luck

if you really need help on this you can page me the sound file, and ill be happy to test for solutions and provide you with whatever code you need
In response to Towers
I'm currently playing the song at 0 volume during login, then nulling it right after. This allows me to play the song up when I need it to, without lagging the game but it adds a 2-3 login delay that I've hid with a loading screen. I'm tired of having that annoying login delay though but I can't find any other way at the moment. I'll try out sound_stream though and I'll send you the file in a bit. It's uploading at the moment.