[J2ME]How to play the sound smooth?

Started by
2 comments, last by shmoove 18 years, 8 months ago
Hi I have some trouble with my game. When The Prince attack, it should play a att.mid at the same time. Unfortunately when i transfer the att.start() function, the game will be block for a short time. So my game become disfluency. everybody can tell my how to play the sound smooth? Thanks!
Advertisement
Have you tried prefetching the sound before you need it?

shmoove
Thanks for your reply!
I have already preteching/realizing the Player when i creat it, the code like below:
att = Player.creatPlayer(file, "auto/midi");
att.realize();
att.start();

But unfortunately play sound will block my game and my game become so disfluency, how to resolve this question? everyone can help me? this game is my first game in my Corporation and I must done it on time!
Are you creating and prefetching the Player ahead of time or only when you need to play the sound?

shmoove

This topic is closed to new replies.

Advertisement