Solved

sound

Posted on 2002-04-11
2
158 Views
Last Modified: 2010-03-31
Hi,

i am having no look with adding sound into my application.
this is the code i have so far.

public void mousePressed(MouseEvent event)
{
Object source = event.getSource();
if (source == comparelsbuttons[0])
{ System.out.println("mpsd comparelsbuttons[0]");
earlyactivitiescount++;
comparelsbuttons[0].removeMouseListener(this);
WellDoneSound();
}
}


public void WellDoneSound()
{
System.out.println("In welldonesound 1");
try
{
System.out.println("In welldonesound 2");
URL welldoneurl = new URL("file://C:/Java/FYP/sounds/welcome.wav");
AudioClip welldoneclip = JApplet.newAudioClip(welldoneurl);
welldoneclip.play();
}
catch (MalformedURLException e){System.err.println(e.getMessage());}
}

the application is compiling and running correctly.
the sound file is functioning correctly both on its own and in another tester application!
any ideas???????

thank you



0
Comment
Question by:Codster
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 10 total points
ID: 6935399
Whats the sample rate of your wav file?
0
 

Author Comment

by:Codster
ID: 6935403
i havent got a clue? where will i find that?
Thank you
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 84
servlet  URL Rewriting 1 42
how to install java on RHEL image on EC2 4 41
spring jars download 1 35
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question