You Are Here:

Community: Developer Discussion Boards

#1 Old Angry problem with playing wav file - 2005-03-29, 16:09

Join Date: Jan 2005
Posts: 7
pushpendra
Offline
Registered User
Hi
I am getting this error while trying to play a wav file.....I have just switched to Nokia Developer's Suite 2.2 for J2ME™ from SUN-WTK where everything was fine.

java.lang.ClassCastException: com.sun.media.sound.RealTimeSequencer
at com.nokia.phone.sdk.concept.mirrors.mma.media.player.MidiPlayer.doRealize(MidiPlayer.java)
at com.nokia.phone.sdk.concept.mirrors.mma.media.player.TonePlayer.doRealize(TonePlayer.java)
at com.nokia.phone.sdk.concept.mirrors.mma.media.player.BasicPlayer.realize(BasicPlayer.java)
at com.nokia.phone.sdk.concept.mirrors.mma.media.MMAManager.init(MMAManager.java)
at com.nokia.phone.sdk.concept.mirrors.mma.media.MMAManager.createPlayer(MMAManager.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.nokia.phone.sdk.concept.gateway.e.a(e.java)
at com.nokia.phone.sdk.concept.gateway.e.run(e.java)
at java.lang.Thread.run(Thread.java:595)


Another question, for my work only nokia 6680/6681 can work, so is there any way to try my program on emulation tool of these phones only?

Thanks
Pushpendra
Reply With Quote

#2 Old 2005-03-30, 15:26

Join Date: Jul 2003
Posts: 46
rantalah
Offline
Registered User
Could you post the piece of code you're using?

Is the wav file linear or is e.g. u-law?
Reply With Quote

#3 Old 2005-03-30, 16:08

Join Date: Jan 2005
Posts: 7
pushpendra
Offline
Registered User
Hi buddy,
thanks for replying...here is the code that is giving problem. I really do not know what kind of .wav file it is ( how do we find it out). It is of size ~20kb.


try{
in = getClass().getResourceAsStream("/correct.wav");
p= Manager.createPlayer(in, "audio/x-wav");
}
catch(Exception e)
{
System.out.println("Exception in initiator: "+e);
}

This code runs fine with Sun WTK but somehow nokia toolkit is giving probem

Thanks in advance,
Regards
Pushpendra
Reply With Quote

#4 Old also problem with nextInt - 2005-03-30, 17:19

Join Date: Jan 2005
Posts: 7
pushpendra
Offline
Registered User
Hi
I am also getting
Alert: no such method nextInt()...I have imported java.util.Random and using a simple code...


Random random = new Random();
int i = random.nextInt(1601);

Why this is aproblem with nokia?? :(

Regards,
Reply With Quote

#5 Old 2005-03-30, 18:30

Join Date: Jul 2003
Posts: 46
rantalah
Offline
Registered User
How long is the wav file? If it's 20kb it shouldn't last more than 2.5 s. If you transfer the wav file alone to the phone, does it play?

Random.nextInt() does not take a parameter.
Reply With Quote

#6 Old 2005-03-30, 20:07

Join Date: Jan 2005
Posts: 7
pushpendra
Offline
Registered User
Hi
Ya, it last for two secnds only. I actually don't have a phone yet to try it out.
There are two nextInt()s. One of them takes a int number and generates random number between 0 and given number.
I was tryng to use that..
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ