my audioclip won't work

Discussion in 'Java' started by MrThis, Jun 26, 2005.

  1. MrThis

    MrThis Guest

    My audio clip program (below), won't work. What am I doing wrong?
    thanks


    import java.awt.*;
    import java.applet.*;
    import java.net.URL;


    /*
    <applet code = "Playit" width=200 height=200>
    <applet>
    */

    public class Playit extends Applet{
    public void init() {


    AudioClip sound = getAudioClip(getDocumentBase(), "lightsout.wav");
    sound.play();


    }

    }
     
    MrThis, Jun 26, 2005
    #1
    1. Advertisements

  2. Maybe it is just lazy. HAve you tried flogging it? [ ;-) ]
    Look at the console in the browser, that often speaks volumes.
    And supply an URL to your (broken) web page/applet as it is.
     
    Andrew Thompson, Jun 26, 2005
    #2
    1. Advertisements

  3. MrThis

    Mickey Segal Guest

    In versions of Java that I've used, you need AU format instead of WAV
    format:
    http://java.sun.com/docs/books/tutorial/sound/playing.html

    In older versions of Java you needed sounds sampled at 8 kHz.
     
    Mickey Segal, Jun 26, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.