Perry Smith

Java Questions & Answers

Home / Java Q & A Page 2 / Java Q & A Archive Main Page

9-30-98

Help about palying audio files

      Hello,
      I was trying to run a simple applet that plays an audio file,
      the compilation was suceessful, but when I run it with the appletviewer,
      I got the following error messages:
      sun.audio.HaeException: Audio Device Unavailable at sun.audio.HaeMixer.reengageAudio0(Native Method) at
      sun.audio.HaeMixer.reengageAudio
      (HaeMixer.java:495)
      sun.audio.AudioDevice.open(AudioDevice.java:270)
      sun.audio.AudioPlayer.(AudioPlayer.java:152)
      sun.audio.AudioPlayer.getAudioPlayer(AudioPlayer.java:90)
      sun.audio.AudioPlayer.(AudioPlayer.java:69)
      sun.applet.AppletAudioClip.play(AppletAudioClip.java:118)
      at audio.init(audio.java:13)
      sun.applet.AppletPanel.run(AppletPanel.java:284)
      at java.lang.Thread.run(Thread.java:490)

      The code i wrote was very simple:
      import java.applet.*;
      import java.awt.*;
      import java.io.*;

      public class audio extends Applet {

      AudioClip testclip;

      public void init() {

      System.out.println("Inside the applet: "+ getCodeBase());
      testclip = getAudioClip(getCodeBase(), "1.au");
      testclip.play();
      //repaint();

      }

      } //end applet
      It would be very grateful of you if you could help me settle down this problem
      Thanks

      Mohammed El mehdi yahyaoui

Responses
9-30-98

Re: Help about palying audio files

Unless you're running this on your own computer, it sounds like a system specific problem to me. Here your program does not have access to the computer's resources that would enable sound. Try the code on another machine that is not in that same local network.

MikeD


9-30-98

Re: Re: Help about playing audio files

This usually happens with school computers where the system administrator has disabled sound (so that people aren't blasting their RealAudio players while the guy next to him is working on that term paper that's due tomorrow).

MikeD


Home / Java Q & A Page 2 / Java Q & A Archive Main Page