Package javax.sound.sampled

Examples of javax.sound.sampled.Line$Info


  }

  protected void createSource() throws JavaLayerException {
    Throwable t = null;
    try {
      Line line = AudioSystem.getLine(getSourceLineInfo());
      if (line instanceof SourceDataLine) {
        source = (SourceDataLine) line;
        source.open(audioFormat);
        source.start();
      }
View Full Code Here


     * clip if required.
     * @param event the line event to follow
     */
    public void update(LineEvent event) {
        if (event.getType().equals(LineEvent.Type.STOP)) {
            Line line = event.getLine();
            line.close();
        } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
            /*
             *  There is a bug in JavaSound 0.90 (jdk1.3beta).
             *  It prevents correct termination of the VM.
             *  So we have to exit ourselves.
View Full Code Here

     * This is implemented to listen for any line events and closes the
     * clip if required.
     */
    public void update(LineEvent event) {
        if (event.getType().equals(LineEvent.Type.STOP)) {
            Line line = event.getLine();
            line.close();
        } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
            /*
             *  There is a bug in JavaSound 0.90 (jdk1.3beta).
             *  It prevents correct termination of the VM.
             *  So we have to exit ourselves.
View Full Code Here

     * This is implemented to listen for any line events and closes the
     * clip if required.
     */
    public void update(LineEvent event) {
        if (event.getType().equals(LineEvent.Type.STOP)) {
            Line line = event.getLine();
            line.close();
        } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
            /*
             *  There is a bug in JavaSound 0.90 (jdk1.3beta).
             *  It prevents correct termination of the VM.
             *  So we have to exit ourselves.
View Full Code Here

public class LineEventTest extends TestCase {

    public void testLineEvent() {

        Line line = new MyLine();
        LineEvent le = new LineEvent(line, LineEvent.Type.CLOSE, 1l);
        assertEquals(line, le.getSource());
        assertEquals(1, le.getFramePosition());
        assertEquals(line, le.getLine());
        assertEquals(LineEvent.Type.CLOSE, le.getType());
View Full Code Here

     * This is implemented to listen for any line events and closes the
     * clip if required.
     */
    public void update(LineEvent event) {
        if (event.getType().equals(LineEvent.Type.STOP)) {
            Line line = event.getLine();
            line.close();
        } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
            /*
             *  There is a bug in JavaSound 0.90 (jdk1.3beta).
             *  It prevents correct termination of the VM.
             *  So we have to exit ourselves.
View Full Code Here

  protected void createSource() throws JavaLayerException
    {
        Throwable t = null;
        try
        {
      Line line = AudioSystem.getLine(getSourceLineInfo());
            if (line instanceof SourceDataLine)
            {
             source = (SourceDataLine)line;
                //source.open(fmt, millisecondsToBytes(fmt, 2000));
        source.open(fmt);
View Full Code Here

      Mixer m = AudioSystem.getMixer(mixerInfo);
      Line.Info[] lineInfos = m.getSourceLineInfo();
      for (Line.Info li:lineInfos) {
        if (li instanceof Port.Info){
          Port.Info pi=(Port.Info)li;
          Line portLine=m.getLine(pi);
          printPortControls(portLine);
        }
      }
      lineInfos = m.getTargetLineInfo();
      for (Line.Info li:lineInfos) {
        if (li instanceof Port.Info){
          if (li instanceof Port.Info){
            Port.Info pi=(Port.Info)li;
            Line portLine=m.getLine(pi);
            printPortControls(portLine);
          }
        }
      }
    }
View Full Code Here

      Line.Info[] lineInfos = m.getSourceLineInfo();
      for (Line.Info li:lineInfos)
                        {
                           

                            Line line;
                            try
                            {
                                line = m.getLine(li);
                                Control[] c = line.getControls();
                                FloatControl volume= (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);                                
                                float max = volume.getMaximum();
                                float min = volume.getMinimum();
                                float dist = max-min;
                               
                                float v = dist /100 *vol;
 
View Full Code Here

     * This is implemented to listen for any line events and closes the
     * clip if required.
     */
    public void update(LineEvent event) {
        if (event.getType().equals(LineEvent.Type.STOP)) {
            Line line = event.getLine();
            line.close();
        } else if (event.getType().equals(LineEvent.Type.CLOSE)) {
            /*
             *  There is a bug in JavaSound 0.90 (jdk1.3beta).
             *  It prevents correct termination of the VM.
             *  So we have to exit ourselves.
View Full Code Here

TOP

Related Classes of javax.sound.sampled.Line$Info

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.