Solved

sound

Posted on 2002-04-11
2
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

617 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