AudioClip, one wav works.. another doesn't?

I'm trying to use the AudioClip class.. and the example I copied over works fine (see code below) but when I change the sound file it stops working. Tried wrapping it in a try and catch and printing any error.. but it seems there is no error as it isn't printing anything :)
I tried to change it with this wav http://www.airwolf.100megsfree.com/airwolf4.wav (and of course changing the TstSnd.wav to airwolf4.wav, placing it in the same folder as TstSnd.wav)
The sound file with the code can be found here:
[http://www.roseindia.net/java/example/java/applet/PlaySoundApplet.shtml]
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class PlaySoundApplet extends Applet implements ActionListener{
  Button play,stop;
  AudioClip audioClip;
  public void init(){
    play = new Button("  Play in Loop  ");
    add(play);
    play.addActionListener(this);
    stop = new Button("  Stop  ");
    add(stop);
    stop.addActionListener(this);
    audioClip = getAudioClip(getCodeBase(), "TstSnd.wav");
  public void actionPerformed(ActionEvent ae){
    Button source = (Button)ae.getSource();
    if (source.getLabel() == "  Play in Loop  "){
      audioClip.play();
    else if(source.getLabel() == "  Stop  "){
      audioClip.stop();
}

Encephalopathic wrote:
Could the problem have anything to do with your using == to compare strings? Don't do this; use String#equals(...)Bad example I copied over.. but it worked for TstSnd.wav as mentioned.
I think I've found my problem in the following
You cannot play WAV, AU, AIFF, or AU files compressed using ADPCM or other compression schemes. The Java Sound engine supports only linear PCM audio files. Though I'd kinde expect that to throw an error if wrapped in a try catch..

Similar Messages

  • I have two intel-era Mac Pros. One at work, another at home.  Two months ago both started having same mix of freezes/hangs

    I own two Intel-era Mac Pros, one at work, the other at home office.  A couple months ago both started having the same problem: a mix of freezes/hangs and weird graphical artifacts showing up on the screens.  Usually I need to reboot. Usually a reboot fixes the problem for a while until it recurs. If it was just one computer, I'd figure disk problem or graphics card.  But the fact that both have been affected at the same time makes me suspect some software issue or possibly a trojan/virus.  Has anyone seen something like this?  Or have any advice?

    The OS is still @ 10.4.8?
    FBDIMMs tend to fail over time due to heat stress and more so if not kept cooler than 70*C
    Helps to run SmcFanControl @ 900 rpm - esp in warmer weather
    Monitor the system with Hardware Monitor, it is more accurate and thorough though not as "cute" as some.
    Both have OEM 7300GT or X1900, which requires constant cleaning of dust.
    We aren't mind readers so if you want, then add more details, the System Profile but w/o the serial number.
    Maybe you install the same updates and programs and that is why.
    Yes you could do a clean install on a fresh drive.
    Maybe your drives are years old - and it never hurt to clone the system regularly for backup and maintenance, run Disk Warrior instead or in addition to Disk Utility. And take advantage of new faster drives.
    No it may not be Flash based malware but then Apple isn't supporting pre-Snow Leopard as much if at all. They did offer a limited fix for recent malware.

  • One Hotmail Works Other Doesn't - in Mail

    I was wondering if anyone has had the same problem, or if there's a way around my problem.
    In my Mail application (v2.1), I have multiple accounts.
    1. Home e-mail
    2. .mac account
    3. Hotmail 1 - (university work)
    4. Hotmail 2 - (media production)
    They all worked until this morning, and now the fourth account doesn't.
    Accounts 3 & 4 are set-up to access my MSN Hotmail e-mails through Mail, but today only the 3rd one works. They are both setup the same way with the following settings:
    Incoming Mail Server: pop3hot.com
    Username: [email protected]
    Password: *****
    Outgoing: smtp.btinternet.com (sent through home connection)
    But as i've said, the fourth one stopped today, I thought something had changed, so i deleted the account and tried to set it up again like i had before but got the following message.
    Trying to log into the POP server “pop3hot.com” has failed. Please make sure the username and password are correct. If you continue, you may not be able to receive any email.
    The password and username are correct (i thought that was the problem). I can get further than this, and send e-mails but not receive them through this account. When i select receive message for account, the following pops up:
    There may be a problem with the mail server or network. Check the settings for account "MSN" or try again.
    The server error encountered was: POP user name "[email protected]" unrecognized.
    I've tried all day to see if i can resolve the problem, but since i have no idea what i was doing, i thought i'd come here for an expert to help.
    Mac OS X (10.4.7)
      Mac OS X (10.4.7)  

    Contacted Microsoft and they managed to sort the problem

  • I would like to copy all the songs from one Ipod into another. All the songs are into my Itunes account, I tried to drag and drop the songs from the old Ipod to the new one but it doesn't work. Is there a way to do it ?

    Hello everybody,
    I would like to copy all the songs from one Ipod into another. All the songs are into my Itunes account, I tried to drag and drop the songs from the old Ipod to the new one but it doesn't work. Is there a way to do it ?
    I share one Itunes account with other people from my family and one person would like to keep the same songs on the new Ipod as the ones which were on the old one.
    Thanks in advance for your answer.
    Yan

    Hello Chris,
    Thanks for your answer. I was hoping for an easier answer. Too bad there is no drag and drop solution, it would have been much easier.
    Thanks for answering so fast.
    Bye.
    Yan

  • I have set up all my mac devices to sync with iCloud and all work except for email. When I delete on one device, the delete doesn't occur on the other devices.

    I have set up all my mac devices to sync with iCloud and all applications work except for email. Incoming messages appear on all devices but when I delete on one device, the delete doesn't occur on the other devices.

    Thank you for your interest. I use apple mail to access my two accounts -I guess they are 3rd party accounts. One is a gmail acount and the other is a bigpond account. I admit to a lack of a high level of literacy when it comes to the language around all of this. For example, I am aware that I have an iCloud email account as I managed to set it up, but don't really understand the purpose of it as the last thing I need is yet another email account to oversee.

  • How can I transfer work from one computer to another?

    How can I transfer work from one computer to another?

    Welcome to the forum.
    I can think of three basic ways to accomplish what you wish to do:
    Use the Project Archiver to archive your Project (and check the box to gather the media files), to an external HDD. Probably the easiest way to do it.
    Copy the Project and ALL media files to an external HDD, but be prepared to relink the media files to the Project, as the drive letter (part of the Absolute Path) will have changed.
    Edit loosely, and Share to an AV file, which will be Imported into a New Project on that second computer. Or, edit VERY tightly, and do the same. I like the first, as removing, replacing Transitions, etc., can be much more difficult, unless that "tight edit" is 100% done.
    Good luck,
    Hunt
    Message was edited by: Bill Hunt to correct formatting

  • How can I move the ODI Work Repository from one server to another server?

    How can I move the ODI Work Repository from one server to another server?

    Hi,
    If you would like to move your source models, target models and project contents from Work repository 1 to another work repository.
    I.e. Dev. server to Prod Server.
    1. Firstly, replicate the master repository connections i.e. with same naming conventions manually
    2. Go to Dev. Server work repository -> File Tab -> Click on Export work repository (save it in a folder)
    3. After exporting, you can view the xml files in the folders.
    4. Now, Open the Prod. server and make sure you already replicated mas. rep. details.
    5. Now, right click on model and import source model in synonym mode insert_update (select source model from the folder where your xml file located)
    6. Similarily, import again target then Project.
    Now, check. It should work.
    Thank you.

  • How do I transfer my bookmarks from one computer to another? I have Firefox Home on my phone and I can get them there, but I want to have the same bookmarks on my home computer as I do on my work computer.

    How do I transfer my bookmarks from one computer to another? I have Firefox Home on my phone and I can get them there, but I want to have the same bookmarks on my home computer as I do on my work computer. If I have a user name then where do I sign into Firefox, it should be that easy but I can't seem to figure it out.

    Hey susanneyes,
    Sounds like you want to set up Firefox Sync. This will allow you to keep all of your instances of Firefox synchronized. Just follow the steps in [https://support.mozilla.com/en-US/kb/what-firefox-sync?s=sync&r=0&as=s this article] and you'll be set.
    Hopefully this helps!

  • Is there a way to transfer or copy all my apps to another iPad with a different account? I was required in my job to use the one at work, but I would like to also see my current set ups and apps as in my personal one. Thank you so much!

    Is there a way to transfer or copy all my apps to another iPad with a different account? I was required in my job to use the one at work, but I would like to also see my current set ups and apps as in my personal one. Thank you so much!

    What I suggest is that you try to pair your apple ID with you company ipad and see if it works.
    Here is why::
    I believe that the Apple rules let you. They are something like:
    -- for a shared iDevice, you may put the app on one device
    -- for a device you use exclisively, you may put the app on five (or some number) of iDevices
    I'm not lawyer, so how you interpred this is a question.
    Now, you need to figure out how to do this.
    In the past at least, apple used this terminalogy.
        Personal
        Institution
        Layered. combines personal & institution.
    It depends on how your company has configured the iPad.
    I have read where you can have upto three apple id per device.

  • Hi everyone, I have a computer linked to my iPAD through itunes.  Then my Computer crashed and had to get  a new one. How do I get rid of the old computers link on ipad and get it on new computer bcos is wont work! (doesn't work) PLZ HELP :(

    Hi everyone, I have a computer linked to my iPAD through itunes.  Then my Computer crashed and had to get  a new one. How do I get rid of the old computers link on ipad and get it on new computer bcos is wont work! (doesn't work) PLZ HELP

    what do you mean the old computers link?
    my ipad is sycned with my computer but nowhere is there a link
    and if I connected it with a new computer and set it to sync it would replace all my data with the data from the new computer

  • My new iPad air is suddenly asking for a pass code. I have only just finished restoring it from my iPad 2 and I didn't set one. The one I used before doesn't work. What can I do?

    My new iPad air is asking for a pass code. I have only just finished restoring it via iTunes from my ipad2 and I didn't set one. The one I used before doesn't work. What can I do?

    http://support.apple.com/kb/HT1212

  • I created a playlist with 100 songs.  I want those 100 songs played using the shuffle option.  This no longer works in iTunes version 11.1.5.5  How can I get an entire  playlist to paly one song after another by using the switch option?

    I created a playlist with 100 songs.  I want those 100 songs played using the shuffle option.  This no longer works in iTunes version 11.1.5.5  How can I get an entire  playlist to paly one song after another by using the switch option?

    You're welcome.
    Going back to your original post:
    5) Tried running Itunes in 'safe mode', running itunes as an administrator..nothing.
    Was that iTunes' safe mode as opposed to Windows' safe mode? iTunes safe mode is invoked by holding down CTRL+SHIFT immediately after clicking the icon to launch iTunes and continuing to hold until this message pops up:
    Click continue, then close iTunes and reopen. With luck iTunes now opens normally every time.
    tt2

  • Synaptics touchpad on HP Mini 110 Windows 7 32 Bit - not working for one user - working for another

    Hi,
    I recently have an issue with Synaptics touchpad on HP Mini 110 Windows 7 32 Bit - NOT working for one user - working for another.
    Windows 7 updates recently installed ???
    By checking the device properties on the user that works - "Synaptics PS/2 Port Touchpad 13/10/2011 Version 15.3.29.0"
    When the other user logs on, the touchpad works for a few seconds, then a displays a black square with a red diagonal line through it, then the touchpad won't respond. Trying to use the keypad to navigate to system diagnosics or anything to find further info is useless....

    Hey eagle_no11,
    Thank you for joining the HP Support Community!
    I will do my best in assisting to hopefully get the TouchPad to work on the second user profile.
    What I would like to start off with, is to restore the original Synaptics drivers onto the profile that is not working correctly. I have included the document Using Recovery Manager to Restore Software and Drivers (Windows 7).
    Once you have installed the original drivers, you will need to complete all updates from both HP, as well as Windows. For these updates, if you open the HP Support Assistant, and select Maintain, you should see an option for updating.
    Please let me know how these steps do work out for you.
    Have a great day!
    I worked on behalf of HP

  • My iPad air won't charge at all and I don't know if it's the charger or port help!i have had a new port put in before and it worked fine after but it's not working now! I have spent way to much trying to fix this thing one problem after another?

    My iPad air won't change at all, and I don't know if it's the port or charger cable it is charging normally but it just won't charge. I have had a new port put in before after a charger getting stuck in there but it worked fine after and now it's not working at all! I don't know if maybe it's the charger getting old but I have spent far too much money on this iPad then I should have as it's one problem after another witch is causing me lots of stress.

    Try giving your iPad a reset. Hold down the sleep and home keys for about 20 seconds. When you see the silver apple, let go and let it reboot and try again.
    How are you charging it? its's best charged plugged into the wall  not via USB. So if you're trying via USB, try using the supplied power block plugged into the wall.

  • I am unable to get Lightroom Mobile to work on my home network. The Ipad says "There are no collections to sync, enable lightroom mobile on your computer", but it is enabled.  I got it to work one time on another network but not at home where I use Lightr

    I am unable to get Lightroom Mobile to work on my home network. The Ipad says "There are no collections to sync, enable lightroom mobile on your computer", but it is enabled.  I got it to work one time on another network but not at home where I use Lightroom.

    Hi,
    could you please give us some info on what kind of network you have?
    Can other application communicate with the web?
    Thanks,
    Ignacio

Maybe you are looking for