Simple wav problem! PLZZZ help!!!!!

Hi,
I have a problem with playin waving files. In my application, i want a sound to be played wen a popup box appears. Here is my code:
AudioClip beep = null;
try
File audioFile = new File("Sounds\\beep.wav");
beep = Applet.newAudioClip(audioFile.toURL());
beep.play();
catch (MalformedURLException e){}
finally
String message = m;
JOptionPane.showMessageDialog(null, message);
However, the sound doesnt seem to play. I wrote some System.out statements for tracing, and apparently the "beep" gets made and played. PLZZZZZ could some1 tell me wots goin rong!!!
Thanks in advance!

I've used Applet.play(URL) OK with .au files. Perhaps you should try to convert your .wav to an .au? (progs like GoldWave will do this)
However I suspect that your URL spec is wrong. Applet.newAudioClip will always return a non null object ; look at its source :
    public final static AudioClip newAudioClip(URL url) {
        return new sun.applet.AppletAudioClip(url);
    }You could try calling openStream on your URL to see if its valid.
- Justin

Similar Messages

  • Simple OOP Problem. Help!

    This is just a simple OOP problem that i cant decide on a best
    implementation for.
    im passing an object to an instance of, 'TabbedFrame', which is just
    a frame with a Tabbed Pane in it that is holding custom panels.
    however, these custom panels need access to the object being
    passed to 'TabbedFrame' and to some methods in it.
    i cant make them static however so how do i gain access to them?
    is my only option to pass the 'TabbedFrame' to each panel?
    like - jtabbedpane.add( "Panel 1", new mypanel1(this));
    here is code:
    new TabbedFrame( DataObject );
    public class TabbedFrame{
    public TabbedFrame(DataObject do){
    this.do = do;
    jtabbedpane.add( "Panel 1", new mypanel1() );
    DataObject do;
    public class mypanel1{
    public mypanel1(){
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    }i would just pass the DataObject to evey panel (there are 12) but
    i also need to be able to call methods in the 'TabbedFrame'.
    Any help would be appreciated!

    Modify mypanel1's constructor:
    public class mypanel1{
    TabbedFrame tf;
    public mypanel1(TabbedFrame tf){
    this.tf = tf;
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    DataObject theDo = tf.getDataObject();
    tf.someMethod(); // Call method on the TabbedFrame
    }In TabbedFrame:
    public TabbedFrame(DataObject do){
    this.do = do;
    // Modify call to constructor to pass "this" TabbedFrame.
    jtabbedpane.add( "Panel 1", new mypanel1(this) );
    }

  • HT2573 I am using macbook pro with update of 10.7.5...I am not able to authorize my digital signature. It is showing crypto service provider is missing. I am in a big problem. plzzz help me out....thanx

    I am using a mac book pro version 10.7.5..I am not able to authorize my digital signature.It is showing crypto service provider is missing. I am in a big problem . plzzzz help me out. Thanks

    You have 10.6 on that machine, I suggest you stick with it for performance, third party hardware and software reasons as long as possible.
    Consider 10.8 (not 10.7) when it's released, because 10.7 and 10.8 will require a new investment in software and newer third party hardware as it requires newer drivers the old machines won't have. (forced upgrade because of software, really nice of them)
    http://roaringapps.com/apps:table
    Far as your Safari problem do these things until it's resolved:
    1: Software Update fully under the Apple menu.
    2: Check the status of your plug-ins and update (works for all browsers) also install Firefox and see if your problems continue. You should always have at least two browsers on the machine just in case one fails.
    https://www.mozilla.org/en-US/plugincheck/
    Flash install instructions/problem resolution here if you need it.
    How to install Flash, fix problems
    3: Install Safari again from Apple's web site
    https://www.apple.com/safari/
    4: Run through this list of fixes, stopping with #16 and report back before doing #17
    Step by Step to fix your Mac

  • SIMPLE ILLUSTRATOR PROBLEM..HELP PLEASEEE

    INTRO
    hey so i am designing a logo for my uni course, and its due quite soon and i need help on a very simple thing.
    OVERVIEW
    I've drawn a picture using the line tool, all the lines are connected creating various shapes...
    PROBLEM
    i need to know how to fill them with colour.... i can slect the shapes i want to fill and use object-live paint-make. but tht means i can only fill...i need to be able to use the mesh tool to create effects....
    any help would be greatly appreciated. Thanks

    Problem is when you use the line tool, where two lines intersect, they stay as seperate entities. In other words the line tool was design to just create a line. However if you want to take the time you can use the point selection tool (lowercase a on keyboard) Drag select the corner where they intersect, right click and select join (windows) (also object>path>join or ctrl-j will work), select the type of corner you want, then hit ok. And repeat for each corner.
    When you are done you can give it a fill or a path color and size.
    Or create a new layer, (Optional: change the color of the path to make it easier to see what you are doing)
    lock the old layer,
    select the pen tool and click on top of each corner (point or anchor).
    When you reach the last point the cursor will change to tell you that you are closing the path.
    At this point you can change the fill and path color/size.

  • Server/problem plzzz help

    hey guys am new in JSP i had just mad simple apps that in 1st page u enter ur name then 2nd page it says hello name
    but after i click on button okay in 1st page i got this
    the Server encountered an internal eror() that pevented it from fullfilling the request.
    and gives me exceptions
    what does this mean and what should i do!!!

    To debug the situation, you can try the following:
    - Check the server logs for more detailed messages.
    From the runtime tab, select the server in question, right-click and select 'View Server Logs'. If this menuitem is not present in the ide version you are using, you may need to check the log from the server's admin console.
    - Check the ide log file to see if there are any messages and/or stacktraces.
    The log file for the ide is found in <userdir>/var/log/messages.log file. To find out <userdir>, please take a look at http://blogs.sun.com/karthikr/entry/jse_directories
    - Debug the project within the ide. (Right-click project and select debug project).
    If you need help, please post any error messages you find in log files along with information on your project, server being used etc.

  • BIGGGG PROBLEM PLZZZ HELP!!!!

    k i baught my nokia n73 a month ago i live in canada and my phone is not supported here i forgot my password the security code that locks the phone after im done working on it,, i set it to lock after 3 min ne ways i called my provider they cant help because im in canada i also called nokia canada and they also cant help and i also asked the place were i baught my nokia from they cant help me i dont know what to do i changed the code it was factory setting which is 12345 but now its something else that i cant remeber i cant get past opening screen it is requeting security code, some people told me to flash the firmware but i dont think i can because if im going to connect the usb im gonna need to activate the pc suite from my phone so i dont know can ne one help plzz my phone has been like this for almost a month now. i have the original package the phone is not stolen. thxMessage Edited by nadim_k6 on 12-Nov-2006
    02:00 AM

    To flash it i will need to take it to a nokia service center? or can i do it myself because i dont think theres any nokia service centers here in Canada that supports my phone. i dont care if all my data in the phone are gone because i need to use the phone its been locked for 3 weeks i cant call i can only recieve calls.Message Edited by nadim_k6 on 13-Nov-2006
    06:04 PM

  • SIMPLE MASKING PROBLEM. HELP NEEDED

    doing some simple masking of text in a scene. got my 0%
    brightness set on one layer and on another layer i have the same
    word with -80% brightness set. then i have a spotlight effect on
    the third layer. when i check if it works within the flash file, it
    works. when i test my movie it doesn't work!!!!!
    i cannot see what i am doing wrong!
    if somebody could answer as soon as possible as i have to
    hand this assignment in tomorrow!!!! THANK YOU!

    Breaking apart - will work - will also not permit you to have
    the ability to edit the text as a font
    - so if you decide breaking apart is the way to go (always
    better to shange text to Static or embed
    font outlines), make sure you copy/paste the textfield to a
    new layer off the stage or set it to a
    guide layer so it is not included in exported SWF in canse
    you ever want to edit it later.
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    KrahnikBoi wrote:
    > It will work if you break it apart. It should also work
    if you embed the
    > font.
    >
    > --KB
    > "fudge_ona_stick" <[email protected]> wrote in
    message
    > news:ejhsb0$qbc$[email protected]..
    >
    >>yep, i've heard that too...
    >>
    >>static text will mask but dynamic and input text have
    serious issues...
    >>you could always "break apart" the text and you won't
    have masking issues.
    >
    >
    >

  • Simple package problem ,please help

    package test;
    public interface Ya
    public void doit();
    this is stored in cd\jdk1.3\test as Ya.java and compiled it in the same directory.
    NExt i make
    package test;
    public class make implements Ya
    public void doit()
    System.out.println("Hi");
    when I compile it in cd\jdk1.3\test
    it says
    cannot resolve symbol Ya.
    ????? whats going on?

    Hi! All you need is to set the environment variable classpath. If you are working in NT environment, go to my computer, right click it, choose properties. Search tabs for the "environment variables" buttons, click it.
    In the variable list click new, enter variable name classpath and then give the value c:\jdk1.3. i.e, the parent directory of your package. Compile all classes.
    If you are a 98/Me user, edit autoexec.bat and write,
    set classpath=c:\jdk1.3
    you have to execute autoexec.bat or simply restart your computer simply to activate changes.
    See your os manual for setting environmental variables if you are working in another os.

  • Packages problem plzzz help

    I have a sourcecode with the package hierarchy as package1.package2.something. Can anybody tell me how can i change the whole package into package3.package2.something nd compile it ? how can i do this ?

    I have a sourcecode with the package hierarchy as
    package1.package2.something. Can anybody tell me how
    can i change the whole package into
    package3.package2.something nd compile it ? how can i
    do this ?Find the statement
    package package1.package2.something;
    replace it with
    package package3.package2.something;
    and compile. Such things could be done much easily with an IDE.

  • Plzzz help me Jumping because of the antenna in iphone 5s

    plzzz help me >> Jumping because of the antenna in iphone 5s
    plz help me i from irann 2day ago Jumping because of the antenna

    Hi there , I bought the phone a month then suddenly jumped up and went to the phone antenna antenna on a search and did not even put my sim card out and then I had a message and phone repairman and he took the Restore and Restore to error -1 and the other came up and now I do not know what is in dfu yo I do not hit the phone rather then the water went into the antenna settings modem firmware was empty . now says  have a problem , anyone who has 'm handset , and the repair of put kept base -band phone. No way that 's true ? I 'm from Iran and the Persian language, I typed into Google translate to English mistake, please help me if you can
    iphone 5s 16 gb  me34LL/A 
    <Personal Information Edited by Host>

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

    Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
      <result id="">
        <xsl:apply-templates>
      </result>
    </xsl:template>

  • Integration problem plzz help

    HI,
    to all experts.
    i am facing a problem..plzzz help
    we have several different modules which are .ear file..
    now we have to combine those modules into one a big application,and we want to add new modules also..this is one task..
    the other one is,we 've already delivered some modules to client.now the client want to update his application by adding the new modules .he doesn't want to change his entire application.
    those modules r in ear format.
    we have to develope an executable which detects already existing modules and it should add the new modules..
    the technologies what we used is Jsp,servlets...ant
    what we r going to use is ejb3.0,ant,other tech like xml also..
    Any ideas how to do,
    Thanks

    Restart. If that doesn't help, re-install. Your JVM installation can't access its rt.jar.

  • Why is "erase junk mail" de-highlighted in the drop down menus.  I'm not able to delete my junk mail box without doing each one individually.  Simple, but please someone help with an answer.  Thanks.

    why is "erase junk mail" de-highlighted in the drop down menus.  I'm not able to delete my junk mail box without doing each one individually.  Simple, but please someone help with an answer.  Thanks.

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • Audio Clip problem plz help..

    There is some problem with my code. It is actually for simply playing a wav file.
    It gives errors on two lines....
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class MediaPlayerDemo extends JFrame
         AudioClip clip; //Error Here
         public MediaPlayerDemo(String title)
              super(title);
         clip = getAudioClip(getCodeBase(),"access.wav"); //Error Here
         clip.loop();
         public static void main(String args[])
              MediaPlayerDemo m = new MediaPlayerDemo("Title");
              m.setSize(400,400);
              m.setVisible(true);
    }

    "Audio Clip problem plz help"
    You have to learn to help yourself.
    Have you done anything to try to fix the errors yourself?
    AudioClip clip; //Error Here
    the error generated here is self-explanatory.
    if you can't fix this, you should get a good book on java basics and start again.
    the other error is also easy to fix.

  • Urgent.. JSTL problem. plz help

    I need some help with JSTL string comparison. Plzz someone help!
    I am retrieveing values from an xml file and checking for equality between two strings. Even though the strings are same it does not go in the if condition where I check for equality. I am able to retrieve the correct value from xml and also it is same because I am dispalying the values but its comparison is false. Could someone tell me a possible reason for the same.
    Plzzz help..I am stuck up with this problem since quite long and not able to get a solution.
    this is the code where I compare
    <c:out value="${d} : ${e} : ${d == e}"/>
    the output i get is
    [name="ROSS"] : [name="ROSS"] : false
    I even calculated the length of the string ..that too is same 4, 4 ! So I do not think there are any blank spaces.
    Plzz help!
    Thanks a lot!

    It looks like you are comparing two objects that both have a toString method that returns the same value. Doesn't mean the objects are equal.
    what are d and e?
    if they are objects I'm not sure the best way to compare the two values...
    perhaps add a getValue method to the object and then compare {d.value==e.value}

Maybe you are looking for