Package javax.sound.sampled

Examples of javax.sound.sampled.FloatControl$Type


      System.out.println();

      ExprManager em = new ExprManager();
      SmtEngine smt = new SmtEngine(em);

      Type t = em.booleanType();
      Expr a = em.mkVar("a", em.booleanType());
      Expr b = em.mkVar("b", em.booleanType());
      Expr e = new Expr(em.mkExpr(Kind.AND, a, b, new Expr(a).notExpr()));
      System.out.println("==> " + e);
View Full Code Here


            audioInputStream = AudioSystem.getAudioInputStream(resourceURL);
            AudioFormat audioFormat = audioInputStream.getFormat();
            DataLine.Info dataLineInfo = new DataLine.Info(Clip.class, audioFormat);
            Clip clip = getClip(dataLineInfo);
            clip.open(audioInputStream);
            FloatControl volctrl=(FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
            volctrl.setValue(volume);
            clip.start();
        } catch (UnsupportedAudioFileException ex) {
            resourceLogger.log(Level.SEVERE, null, ex);
        } catch (LineUnavailableException ex) {
            resourceLogger.warning("cannot play audio resource, due to " + ex.getLocalizedMessage());
View Full Code Here

            e.printStackTrace();
            return;
        }

        if (auline.isControlSupported(FloatControl.Type.PAN)) {
            final FloatControl pan = (FloatControl) auline.getControl(FloatControl.Type.PAN);
            if (this.curPosition == Position.RIGHT) {
                pan.setValue(1.0f);
            } else if (this.curPosition == Position.LEFT) {
                pan.setValue(-1.0f);
            }
        }

        auline.start();
        int nBytesRead = 0;
View Full Code Here

      return;
    }

    if (auline.isControlSupported(FloatControl.Type.PAN))
    {
      FloatControl pan = (FloatControl) auline
          .getControl(FloatControl.Type.PAN);
      if (curPosition == Position.RIGHT)
        pan.setValue(1.0f);
      else if (curPosition == Position.LEFT)
        pan.setValue(-1.0f);
    }

    auline.start();
    int nBytesRead = 0;
    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
View Full Code Here

            logger.info("JavaSoundRenderer: sourceLine=" + sourceLine);
            sourceLine.open(audioFormat);
            logger.info("JavaSoundRenderer: buflen=" + sourceLine.getBufferSize());
           
            // fetch gain control
            FloatControl gainFloatControl = null;
            try
            {
                gainFloatControl = (FloatControl)sourceLine.getControl(FloatControl.Type.MASTER_GAIN);
            }
            catch (Exception e)
View Full Code Here

      auline = (SourceDataLine) AudioSystem.getLine(info);
      auline.open(format);

      if (auline.isControlSupported(FloatControl.Type.PAN)) {
        FloatControl pan = (FloatControl) auline.getControl(FloatControl.Type.PAN);

        if (curPosition == Position.RIGHT) {
          pan.setValue(1.0f);
        } else if (curPosition == Position.LEFT) {
          pan.setValue(-1.0f);
        }
      }

      auline.start();
View Full Code Here

      e.printStackTrace();
      return;
    }
    if (auline.isControlSupported(FloatControl.Type.PAN)) {
      FloatControl pan = (FloatControl) auline
          .getControl(FloatControl.Type.PAN);
      if (curPosition == Position.RIGHT)
        pan.setValue(1.0f);
      else if (curPosition == Position.LEFT)
        pan.setValue(-1.0f);
    }
    auline.start();
    int nBytesRead = 0;
    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
View Full Code Here

            e.printStackTrace();
            return;
        }

        if (auline.isControlSupported(FloatControl.Type.PAN)) {
            FloatControl pan = (FloatControl) auline.getControl(FloatControl.Type.PAN);
            if (curPosition == Position.RIGHT) {
                pan.setValue(1.0f);
            } else if (curPosition == Position.LEFT) {
                pan.setValue(-1.0f);
            }
        }

        auline.start();
        int nBytesRead = 0;
View Full Code Here

   */
  @Override
  public void setVolume(int volume) {
    super.setVolume(volume);

    FloatControl gainControl = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
    // number between 0 and 1 (loudest)
    float dB = (float) (Math.log(volume / 100f) / Math.log(10.0) * 20.0);
    gainControl.setValue(dB);
  }
 
View Full Code Here

   */
  @Override
  public void setVolume(int volume) {
    super.setVolume(volume);

    FloatControl gainControl = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
    // number between 0 and 1 (loudest)
    float dB = (float) (Math.log(volume / 100f) / Math.log(10.0) * 20.0);
    gainControl.setValue(dB);
  }
 
View Full Code Here

TOP

Related Classes of javax.sound.sampled.FloatControl$Type

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.