Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  adding .wav to j2me games  (Read 2533 times)
0 Members and 1 Guest are viewing this topic.
Offline chandru

Senior Newbie




Java games rock!


« Posted 2005-02-17 08:44:31 »

hi  
        I am N.chandrasekaran from India, I am a Pockect Pc application developer. Now i started developing j2me games for nokia 60 series . I developed a side scrolling game but couldn't able to add  sound to my game if i add the .wav or .mid files using conventional
methods of  "getClass().getResourceAsStream("/hai.wav");" and using input streamreader  it takes a delay to play the sound even if i put this code in a seperate thread. and also takes memory for every call which ultimately let my emulator to hang. so please help me
Offline davidaprice

Junior Member





« Reply #1 - Posted 2005-02-18 04:15:15 »

Did you look at Forum Nokia's MIDP 2.0 game programming example, the Sheepdog game? It uses WAVs, and seems to run fine. You can download it for free from Forum Nokia (including source code and a tutorial document).
Offline chandru

Senior Newbie




Java games rock!


« Reply #2 - Posted 2005-02-21 05:47:37 »

thanks for your replay i downloaded the sheep dog example even this example keep on taking the memory for every sound call watch it in the memory monitor of sun java mobility studio 6 q3.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davidaprice

Junior Member





« Reply #3 - Posted 2005-02-21 08:22:45 »

I don't have Sun Java Mobility Studio. But I modified Sheepdog to display Runtime.getRuntime().freeMemory() at the top of the game screen, and it was continuously decreasing all the time, whether or not the sound effects were being played. My Series 60 phone did a garbage-collection every 20 seconds or so; my PC emulator had so much memory that it didn't need to.

I think that creating a small number of garbage-objects is typical of Java. Even if your own code doesn't, you'll find that the implementation of the MIDP APIs does. As long as the phone's garbage-collector can cope, there's no problem. It's not good that your emulator hangs, but have you tried your application on a real phone?
Offline chandru

Senior Newbie




Java games rock!


« Reply #4 - Posted 2005-02-21 10:20:36 »

thanks for your interest but i thing there are some more problems to be realised.

I already used the System.gc(); to call the garbage collecter but amazingly it doesn't have any effect on the memory occupied by the sound(but it works fine for the memory occupied by images and all). to day i tried your code Runtime.getRuntime().freeMemory() but it too have the same effect. since i am a beginer i may not know some other problems but if you can see that memory moniter of sun java MObility Studio you will surly realise the problem that hides in using sounds.  
Online Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #5 - Posted 2005-02-21 15:06:36 »

Quote
hi  
        I am N.chandrasekaran from India, I am a Pockect Pc application developer. Now i started developing j2me games for nokia 60 series . I developed a side scrolling game but couldn't able to add  sound to my game if i add the .wav or .mid files using conventional
methods of  "getClass().getResourceAsStream("/hai.wav");" and using input streamreader  it takes a delay to play the sound even if i put this code in a seperate thread. and also takes memory for every call which ultimately let my emulator to hang. so please help me


You arn't recreating the player each time you want to play the sound are you?

That will certainly be slow, and will likely leak memory (due to the buggy implementation of InputStreams on most series 60 phones)

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline chandru

Senior Newbie




Java games rock!


« Reply #6 - Posted 2005-02-23 09:24:02 »

did  any one show me a sample code for accessing dictionary of nokia phones ???
Offline davidaprice

Junior Member





« Reply #7 - Posted 2005-02-25 03:57:48 »

The only dictionary in a Nokia phone would be the T9 text prediction dictionary. This is not accessible in any way from standard MIDP, and Nokia provides no proprietary API for accessing it.

If you want to use T9 in your MIDlet's text input, you'll have to use the standard MIDP LCDUI 'high-level' text controls: TextField and TextArea. If you're creating your own, prettier text input controls using Canvas or CustomItem, I'm afraid you won't have T9.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (30 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (43 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!