Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help: How to play sound in j2me programs

 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I want to run an sound in my j2me application but failed to get the way.
I searched into the api given by sun microsystems in j2mewtk1.0.3 but found no class or method which can help me out for my problem.
In extended game api given by siemens i found a class named "Sound" with the single method "playTone(int tone_freq, int tone_time)" but failed to use this as this method takes only two parameters tone_freq and the duration . I doubt if this method can help us to run our own audio or mp3 files.
Now i want to ask:-
1- How can we run our own sound files in j2me program.
2- Which formats of sound files are supported.
3- Is there any other method or class except the above mentioned "Sound" class which can help for the same
if yes then where i can found that? and how can i implement that in my programs?
If No then how can we use playTone() method of Sound class given in games package of siemens api and what all this method can do.
Waiting for the right answer :roll:
Rishi
 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi java gurus,
what happened should i assume that i have asked a foolish question for what no one out of so many java gurus is interested to give answer.
or i have asked some impossible thing.
but dear friends i need help at this as i have to implement it in my applications.
waiting for the reply................
Rishi
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to wait for MIDP 2.0 implementations. MIDP 2.0 supports sound playback. They are working on the RI right now. I think.
Or, you can use the Mobile Media API. But again, you have to have implementation available for your target device.
[ July 25, 2002: Message edited by: Michael Yuan ]
 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Michael.
But does it means that in current release we can't add sounds in our programs.
I will try with this new API and will get back here again.
Once again thankyou for your reply
Regards,
Rishi
 
a sanjuan
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's another thread with info on the new mobile media:
http://forum.java.sun.com/thread.jsp?forum=50&thread=279710
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the mobile media RI is already out. But it is only available through the Sun engineering partners. I talked with a guy in Sun and he said they will make it available from JDC in "this summer".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic