Package javax.sound.sampled

Examples of javax.sound.sampled.Port.open()


                        boolean openPortNeeded = !port.isOpen();
                        try
                        {
                            if (openPortNeeded)
                            {
                                port.open();
                            }
                            if (port.isControlSupported(FloatControl.Type.VOLUME))
                            {
                                FloatControl volumeControl = (FloatControl) port.getControl(FloatControl.Type.VOLUME);
                                float min = volumeControl.getMinimum();
View Full Code Here


    {
                    Port port = null;
                    try
                    {
                            port = (Port) mixer.getLine(infosToCheck[i]);
                            port.open();
                    }
                    catch (LineUnavailableException e)
                    {
                         //   e.printStackTrace();
                    }
View Full Code Here

                        boolean openPortNeeded = !port.isOpen();
                        try
                        {
                            if (openPortNeeded)
                            {
                                port.open();
                            }
                            if (port.isControlSupported(FloatControl.Type.VOLUME))
                            {
                                FloatControl volumeControl = (FloatControl) port.getControl(FloatControl.Type.VOLUME);
                                float min = volumeControl.getMinimum();
View Full Code Here

    {
                    Port port = null;
                    try
                    {
                            port = (Port) mixer.getLine(infosToCheck[i]);
                            port.open();
                    }
                    catch (LineUnavailableException e)
                    {
                         //   e.printStackTrace();
                    }
View Full Code Here

   
    final Mixer mixer = AudioSystem.getMixer(mixerInfoPool[6]);
    try {
      if (mixer.isLineSupported(Port.Info.LINE_IN)) {
        lineIn = (Port) mixer.getLine(Port.Info.LINE_IN);
        lineIn.open();
      } else if (mixer.isLineSupported(Port.Info.MICROPHONE)) {
        lineIn = (Port) mixer.getLine(Port.Info.MICROPHONE);
        lineIn.open();
      } else {
        System.out.println("Unable to get Input Port");
View Full Code Here

      if (mixer.isLineSupported(Port.Info.LINE_IN)) {
        lineIn = (Port) mixer.getLine(Port.Info.LINE_IN);
        lineIn.open();
      } else if (mixer.isLineSupported(Port.Info.MICROPHONE)) {
        lineIn = (Port) mixer.getLine(Port.Info.MICROPHONE);
        lineIn.open();
      } else {
        System.out.println("Unable to get Input Port");
        return;
      }
      lineIn.getControls();
View Full Code Here

                                        // object

    if (AudioSystem.isLineSupported(Port.Info.MICROPHONE)) {
      try {
        Port port = (Port) AudioSystem.getLine(Port.Info.MICROPHONE);
        port.open();
        System.out.println(port.getLineInfo());
//        line.open(getAudioFormat());
//        line.start();
//        while(true) {
////          System.out.println("Level: " + line.getLevel());
View Full Code Here

      mixer = AudioSystem.getMixer(info);
      final int maxLines = mixer.getMaxLines(Port.Info.MICROPHONE);
      if (maxLines > 0) {
        System.out.println(info);
        lineIn = (Port) mixer.getLine(Port.Info.MICROPHONE);
        lineIn.open();
        Control[] controls = lineIn.getControls();
        for (int j = 0; j < controls.length; j++) {
          Control control = controls[j];
          System.out.println(control);
        }
View Full Code Here

      Mixer mixer = AudioSystem.getMixer(info);
      if (mixer.isLineSupported(Port.Info.SPEAKER)) {
        Port port;
        try {
          port = (Port) mixer.getLine(Port.Info.SPEAKER);
          port.open();
          if (port.isControlSupported(FloatControl.Type.VOLUME)) {
            FloatControl volume = (FloatControl) port.getControl(FloatControl.Type.VOLUME);
            closure.execute(volume);
          }
          port.close();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.