How to speed up music play?

Monkey Forums/Monkey Programming/How to speed up music play?

ondesic(Posted 2012) [#1]
I am using PlayMusic to play an ogg file about 176 KB.

The problem is it is taking up to 3-4 sec before the music starts. How do I speed things up. It's not monkey, is it?

I also notice that you can't preload music. You just have to use PlayMusic(path). Is there another way to do it?

Thanks!


Neuro(Posted 2012) [#2]
PlayMusic() streams it. Since your file is that small, maybe you can try preloading with LoadSound() first and then PlaySound() it.


ondesic(Posted 2012) [#3]
I have tried both, but it still is a few seconds slow. PlayMusic seems faster than playsound (which also has a lag). Is there a way to make sre they sound is loaded before allowing the user to interact with the game?


Neuro(Posted 2012) [#4]
The only way to preload a sound file is by using LoadSound(inside the OnCreate method) and then play it with PlaySound(), which should be quite fast. If you're still having a delay then there maybe something wrong with the ogg file itself? Are you able to post that sound file for us to test?