Jump to content
  • Advertisement
Sign in to follow this  
D3DXVECTOR3

[J2ME] Phone not responding at when game is started with phone set to silent mode

This topic is 4748 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im have been working on this game for a while now and everytime im getting problems/errors that dont occur on the emulator. I start playing a midi file at the menu, but if you start the game and the cell phone is in silent mode the phones doeanst respond and it "crashes". Status A: - Phones not in silent mode - Start game -> no problem. midi plaay back works perfect. Status B: - Phone is silent mode - Start game -> phone not responding when trying to playback midi file I couldnt find anything in the documentation, its there a funtion were I can check the status of the phone ie : if its in silent mode. Also how can I load a new midi file when I already have one loaded!? (overriding the previous file) [Edited by - D3DXVECTOR3 on September 23, 2005 6:31:36 AM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
On some devices you can, I believe. I've seen games that do. But more importantly, it shouldn't crash. What device are you talking about? You might wanna try playing the sound in a try/catch structure, see what happens. As to your second question, you need to deallocate the player for the first sound, and realize and prefetch another player for the new one. Don't expect this to be smooth. Another option is to have all sounds in the same midi file, and use setMediaTime(ms) to the position of the sound you want to play. Could be smoother, however on a lot of devices this time setting is very inacurate or at least not reliable.

Post your phone model, I can check it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
^Sorry, meant you should print an error in the catch statement.

Share this post


Link to post
Share on other sites
k, i will try that try/catch thing and see what error message I get.
About the player.

Is this oke!?
player.stop();
player.deallocate();
// player.close() << or do i need to add this line!?

edit:

i see that i dont need to call stop because when the player is playing dealocate() will stop it.

Share this post


Link to post
Share on other sites
maybe, _just_ maybe, when the phone is in silent mode, when you create a soundplayer instance (whatever is called in your sdk), it does not create it and returns a null pointer. when you're calling .play on that instance -> crash.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!