Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

sound

Posted on 2002-04-11
2
Medium Priority
?
165 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 30 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

886 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