Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Sound not loading

 
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...

 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • 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.
 
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: 5167
11
Netbeans IDE Opera Java
  • 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: 5167
11
Netbeans IDE Opera Java
  • 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
 
I love a woman who dresses in stainless steel ... and carries tiny ads:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic