Solved

sound

Posted on 2002-04-11
2
159 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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 …
Suggested Courses

738 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