Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sound not loading

 
Adam Preston
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi my sound will not load when I run my applet... Here's the code try and spot the error btw I am using eclipse IDE and no errors come up when I run it or am typing in the code so its defiantly summin I have done...

 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Preston wrote:Hi my sound will not load when I run my applet


Do you have the two mp3 files, and are they in the right place?

Also, you should get rid of the deprecated method call, not suppress the warning.
 
randy orton
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Preston wrote:Hi my sound will not load when I run my applet... Here's the code try and spot the error btw I am using eclipse IDE and no errors come up when I run it or am typing in the code so its defiantly summin I have done...


hello......
Firstly, don't use stop() method of thread class,its deprecated.
Secondly, you cannot play mp3 using audioclip interface.Convert it into .au.
Thirdly,bye........
 
randy orton
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
Adam Preston wrote:Hi my sound will not load when I run my applet


Do you have the two mp3 files, and are they in the right place?

Also, you should get rid of the deprecated method call, not suppress the warning.

hi.....
as far as i know we cannot play mp3 using audio clip interface............
 
Adam Preston
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kk, thanks guys I'm getting this code from a book which uses JDK 1.1. Is there any way I can still keep the code but modify the stop part. And btw I will try using the .au sound file and report back in a bit. But I got another piece of code on my hands which I am trying to resolve you'll see that posted in a minute... I will also take the suppress warnings off
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
randy orton wrote:
as far as i know we cannot play mp3 using audio clip interface............


Good catch. I hadn't noticed that.
 
Adam Preston
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope still doesn't work... even with the things changed.
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Preston wrote:kk, thanks guys I'm getting this code from a book which uses JDK 1.1. Is there any way I can still keep the code but modify the stop part. And btw I will try using the .au sound file and report back in a bit. But I got another piece of code on my hands which I am trying to resolve you'll see that posted in a minute... I will also take the suppress warnings off


Read the API for the deprecated method. You'll find a recommendation there.

In general, all deprecated method APIs provide the recommended way to accomplish whatever it was that the method does.
 
randy orton
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adam Preston wrote:Nope still doesn't work... even with the things changed.

I had run the code using .au and its working fine.If it still does not work check your applet tag.......
Refer this link for deprecationthread deprecation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic