
-----------------------------------
Dom
Wed Jan 08, 2014 7:33 pm

Java Help
-----------------------------------
// The "Sound" class.
import java.awt.*;
import hsa.Console;

import java.io.IOException;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.spi.AudioFileReader;
import javax.sound.sampled.UnsupportedAudioFileException;
import javax.sound.sampled.LineUnavailableException;


public class Sound
{
    static Console c;           // The output console

    public static void main (String[] args)
    {
        c = new Console ();

        sound ();


    } // main method


    public static void sound ()
    {
        try
        {
            AudioInputStream audio;
            audio = AudioSystem.getAudioInputStream (this.getClass ().getResource ("Deal Or No Deal Full Theme Song.wav"));
            javax.sound.sampled.Clip clip = AudioSystem.getAudioInputStream (java.io.File $1);
            clip.open (audio);
            clip.start ();
        }
        catch (UnsupportedAudioFileException uae)
        {
        }
        catch (IOException ioe)
        {
        }
        catch (LineUnavailableException lua)
        {
        }
    }
} // Sound class



I am working with Ready To Program with Java. I am using HSA consoles. Everything seems to be working except one line: 

javax.sound.sampled.Clip clip = AudioSystem.getAudioInputStream (java.io.File $1); 

where the program is giving me an error with "$1" (it is highlighting only the "$1"). There are no other errors in the program. I am trying to get sound to play when I run the program.

-----------------------------------
Raknarg
Wed Jan 08, 2014 7:48 pm

RE:Java Help
-----------------------------------
Why is there a "$1" in the first place?

-----------------------------------
DemonWasp
Wed Jan 08, 2014 7:49 pm

RE:Java Help
-----------------------------------
Please use either java.io.File $1 as a function argument?

-----------------------------------
Dom
Thu Jan 09, 2014 2:12 pm

RE:Java Help
-----------------------------------
Ready To Program told me to do that. What should I place there instead?

The file I am trying to play is called 

Deal Or No Deal Full Theme Song.wav.

-----------------------------------
Tony
Thu Jan 09, 2014 2:34 pm

Re: RE:Java Help
-----------------------------------
Ready To Program told me to do that.
Link to that documentation please.
