Examples of Mixer


Examples of javax.sound.sampled.Mixer

  }

  private Mixer getMixer() {
    Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
    int cnt;
    Mixer m = null;
    verbose.addConsoleMsg("=Available Mixers=", EnumSet.of(EnumVerbose.ToConsole));
    for (cnt = 0; cnt < mixerInfo.length; cnt++) {
      verbose.addConsoleMsg(mixerInfo[cnt].getName(), EnumSet.of(EnumVerbose.ToConsole));
    }
    verbose.addConsoleMsg("==================", EnumSet.of(EnumVerbose.ToConsole));
View Full Code Here

Examples of javax.sound.sampled.Mixer

    }
   
    public SonarSoundEngine(int maxChannels) throws LineUnavailableException
    {
        silentSample = new SonarSample(new float[] {0}, 44100);
        Mixer mixer = AudioSystem.getMixer(null);

        sdl = (SourceDataLine) mixer.getLine(new Line.Info(SourceDataLine.class));
        sdl.open(new AudioFormat(rate, 16, 2, true, false), bufferSize * 2 * 2 * 2 * 2 * 2);
        soundBuffer.order(ByteOrder.LITTLE_ENDIAN);
        sdl.start();

        try
View Full Code Here

Examples of javax.sound.sampled.Mixer

//Mixer.Info mixerInfo = AudioSystem.getMixer(null).getMixerInfo();
    Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo();
    for (Mixer.Info mixerInfo:mixerInfos)
                {
                        System.out.println("\n"+mixerInfo);
      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

Examples of javax.sound.sampled.Mixer

            try
            {
                Mixer.Info[] mixers = AudioSystem.getMixerInfo();
                for (Mixer.Info info : mixers)
                {
                    Mixer mixer = AudioSystem.getMixer(info);
                    if (mixer.isLineSupported(Port.Info.SPEAKER))
                    {
                        Port port = (Port) mixer.getLine(Port.Info.SPEAKER);
                        boolean openPortNeeded = !port.isOpen();
                        try
                        {
                            if (openPortNeeded)
                            {
View Full Code Here

Examples of javax.sound.sampled.Mixer

                D.addLog("There are no mixers that support Port lines. Sound volume can not be set!",0);
            }
            Iterator<Mixer> iterator = portMixers.iterator();
            while (iterator.hasNext())
            {
                Mixer mixer = iterator.next();
                String strMixerName = mixer.getMixerInfo().getName();
//System.out.println("Mixer: " + strMixerName);
    Port.Info[] infosToCheck = getPortInfo(mixer);
    for (int i = 0; i < infosToCheck.length; i++)
    {
                    Port port = null;
                    try
                    {
                            port = (Port) mixer.getLine(infosToCheck[i]);
                            port.open();
                    }
                    catch (LineUnavailableException e)
                    {
                         //   e.printStackTrace();
View Full Code Here

Examples of javax.sound.sampled.Mixer

    Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo();
    for (Mixer.Info mixerInfo:mixerInfos)
                {
                        System.out.println("\n"+mixerInfo);
      Mixer m = AudioSystem.getMixer(mixerInfo);
                        Control[] c1 =m.getControls();
      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;
View Full Code Here

Examples of javax.sound.sampled.Mixer

//Mixer.Info mixerInfo = AudioSystem.getMixer(null).getMixerInfo();
    Mixer.Info[] mixerInfos = AudioSystem.getMixerInfo();
    for (Mixer.Info mixerInfo:mixerInfos)
                {
                        System.out.println("\n"+mixerInfo);
      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

Examples of javax.sound.sampled.Mixer

            try
            {
                Mixer.Info[] mixers = AudioSystem.getMixerInfo();
                for (Mixer.Info info : mixers)
                {
                    Mixer mixer = AudioSystem.getMixer(info);
                    if (mixer.isLineSupported(Port.Info.SPEAKER))
                    {
                        Port port = (Port) mixer.getLine(Port.Info.SPEAKER);
                        boolean openPortNeeded = !port.isOpen();
                        try
                        {
                            if (openPortNeeded)
                            {
View Full Code Here

Examples of javax.sound.sampled.Mixer

                D.addLog("There are no mixers that support Port lines. Sound volume can not be set!",0);
            }
            Iterator<Mixer> iterator = portMixers.iterator();
            while (iterator.hasNext())
            {
                Mixer mixer = iterator.next();
                String strMixerName = mixer.getMixerInfo().getName();
//System.out.println("Mixer: " + strMixerName);
    Port.Info[] infosToCheck = getPortInfo(mixer);
    for (int i = 0; i < infosToCheck.length; i++)
    {
                    Port port = null;
                    try
                    {
                            port = (Port) mixer.getLine(infosToCheck[i]);
                            port.open();
                    }
                    catch (LineUnavailableException e)
                    {
                         //   e.printStackTrace();
View Full Code Here

Examples of javax.sound.sampled.Mixer

    List<Mixer>    supportingMixers = new ArrayList<Mixer>();
    Mixer.Info[]  aMixerInfos = AudioSystem.getMixerInfo();
    Line.Info  portInfo = new Line.Info(Port.class);
    for (int i = 0; i < aMixerInfos.length; i++)
    {
      Mixer  mixer = AudioSystem.getMixer(aMixerInfos[i]);
      boolean  bSupportsPorts = arePortsSupported(mixer);
      if (bSupportsPorts)
      {
        supportingMixers.add(mixer);
      }
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.