what (clip) and DataLine.Info represents...?

Posted by user528050 on Stack Overflow See other posts from Stack Overflow or by user528050
Published on 2010-12-30T05:44:38Z Indexed on 2010/12/30 5:54 UTC
Read the original article Hit count: 177

Filed under:

I got this code from one of my friend.

import java.io.*;
import javax.sound.sampled.*;
public class xx
{
    public static void main(String args[])
    {
        try
        {
            File f=new File("mm.wav");
            AudioInputStream a=AudioSystem.getAudioInputStream(f);
            AudioFormat au=a.getFormat();
            DataLine.Info di=new DataLine.Info(Clip.class,au);
            Clip c=(Clip)AudioSystem.getLine(di);
            c.open(a);
            c.start();
        }
        catch(Exception e)
        {
            System.out.println("Exception caught ");
        }
    }
}

But i didn't understand what this line means Cilp c=(Clip)AudioSystem.getLine(di); what (clip) represents....? And my 2nd problem is what is the DataLine is it an interface and what is the meaning of this statement DataLine.Info....?

© Stack Overflow or respective owner

Related posts about audio