Meaningless Drivel is fun!*
The moose likes Applets and the fly likes Sound not loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Sound not loading" Watch "Sound not loading" New topic
Author

Sound not loading

Adam Preston
Greenhorn

Joined: Mar 04, 2011
Posts: 24
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

Joined: May 03, 2008
Posts: 4523
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
randy orton
Greenhorn

Joined: May 20, 2011
Posts: 15
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

Joined: May 20, 2011
Posts: 15
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

Joined: Mar 04, 2011
Posts: 24
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

Joined: May 03, 2008
Posts: 4523
    
    5

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

Joined: Mar 04, 2011
Posts: 24
Nope still doesn't work... even with the things changed.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

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

Joined: May 20, 2011
Posts: 15
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sound not loading
 
Similar Threads
How do you create an java alarm clock with audio??
how do you create an java alarm clock with audio?
how do you create an java alarm clock with audio?
How to create an Java Alarm clock with audio?
AudioClip no sound