java类javax.sound.sampled.Mixer.Info的实例源码

SoftMixingMixerProvider.java 文件源码 项目:OpenJSharp 阅读 21 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:jdk8u-jdk 阅读 24 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:openjdk-jdk10 阅读 21 收藏 0 点赞 0 评论 0
@Override
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }
}
SoftMixingMixerProvider.java 文件源码 项目:openjdk9 阅读 19 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:jdk8u_jdk 阅读 19 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 17 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
Main.java 文件源码 项目:forplay 阅读 19 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws InterruptedException {
  for (AudioFileFormat.Type fileFormat : AudioSystem.getAudioFileTypes()) {
    System.out.print(fileFormat + ", ");
  }
  System.out.println();

  System.out.println();
  for (Info info : AudioSystem.getMixerInfo()) {
    System.out.println(info);
  }
  System.out.println();

  Mixer mixer = AudioSystem.getMixer(null);
  int maxLines = mixer.getMaxLines(mixer.getLineInfo());
  System.out.println("maxlines=" + maxLines);
  Thread.sleep(100);

  play("freesoundproject_22740__FranciscoPadilla__37_Click_Finger.wav");
  play("freesoundproject_28917__junggle__btn107.mp3");
  Thread.sleep(1000);
  System.out.println("Done");
}
SoftMixingMixerProvider.java 文件源码 项目:infobip-open-jdk-8 阅读 25 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
Shared.java 文件源码 项目:vocobox 阅读 19 收藏 0 点赞 0 评论 0
public static Vector<Mixer.Info> getMixerInfo(
        final boolean supportsPlayback, final boolean supportsRecording) {
    final Vector<Mixer.Info> infos = new Vector<Mixer.Info>();
    final Mixer.Info[] mixers = AudioSystem.getMixerInfo();
    for (final Info mixerinfo : mixers) {
        if (supportsRecording
                && AudioSystem.getMixer(mixerinfo).getTargetLineInfo().length != 0) {
            // Mixer capable of recording audio if target LineWavelet length != 0
            infos.add(mixerinfo);
        } else if (supportsPlayback
                && AudioSystem.getMixer(mixerinfo).getSourceLineInfo().length != 0) {
            // Mixer capable of audio play back if source LineWavelet length != 0
            infos.add(mixerinfo);
        }
    }
    return infos;
}
SoftMixingMixerProvider.java 文件源码 项目:jdk8u-dev-jdk 阅读 20 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:jdk7-jdk 阅读 19 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:openjdk-source-code-learn 阅读 20 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoftMixingMixerProvider.java 文件源码 项目:OLD-OpenJDK8 阅读 22 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoundMixer.java 文件源码 项目:jace 阅读 19 收藏 0 点赞 0 评论 0
private void initMixer() {
        Info selected;
        Info[] mixerInfo = AudioSystem.getMixerInfo();

        if (mixerInfo == null || mixerInfo.length == 0) {
            theMixer = null;
            lineAvailable = false;
            System.out.println("No sound mixer is available!");
            return;
        }

        String mixer = preferredMixer.getValue();
        selected = mixerInfo[0];
        for (Info i : mixerInfo) {
            if (i.getName().equalsIgnoreCase(mixer)) {
                selected = i;
                break;
            }
        }
        theMixer = AudioSystem.getMixer(selected);
//        for (Line l : theMixer.getSourceLines()) {
//            l.close();
//        }
        lineAvailable = true;
    }
Shared.java 文件源码 项目:vocobox 阅读 21 收藏 0 点赞 0 评论 0
public static Vector<Mixer.Info> getMixerInfo(
        final boolean supportsPlayback, final boolean supportsRecording) {
    final Vector<Mixer.Info> infos = new Vector<Mixer.Info>();
    final Mixer.Info[] mixers = AudioSystem.getMixerInfo();
    for (final Info mixerinfo : mixers) {
        if (supportsRecording
                && AudioSystem.getMixer(mixerinfo).getTargetLineInfo().length != 0) {
            // Mixer capable of recording audio if target LineWavelet length != 0
            infos.add(mixerinfo);
        } else if (supportsPlayback
                && AudioSystem.getMixer(mixerinfo).getSourceLineInfo().length != 0) {
            // Mixer capable of audio play back if source LineWavelet length != 0
            infos.add(mixerinfo);
        }
    }
    return infos;
}
SoftMixingMixerProvider.java 文件源码 项目:openjdk-jdk7u-jdk 阅读 22 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
AudioRecorder.java 文件源码 项目:elphelvision_eclipse 阅读 27 收藏 0 点赞 0 评论 0
public AudioFormat[] GetMixerCapabilities(int MixerIndex) {
    Info[] mixerinfo = AudioSystem.getMixerInfo();

    // select the Mixer to record from
    Mixer mixer = AudioSystem.getMixer(mixerinfo[MixerIndex]);
    Line.Info[] Infos = mixer.getTargetLineInfo();
    for (int i = 0; i < Infos.length; i++) {
        if (Infos[i] instanceof DataLine.Info) {
            DataLine.Info dataLineInfo = (DataLine.Info) Infos[i];
            // these are the available formats of the selected mixer
            AudioFormat[] supportedFormats = dataLineInfo.getFormats();
            return supportedFormats;
        }
    }
    return null;
}
SoftMixingMixerProvider.java 文件源码 项目:openjdk-icedtea7 阅读 24 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
SoundMixer.java 文件源码 项目:lawless-legends 阅读 19 收藏 0 点赞 0 评论 0
private void initMixer() {
        Info selected;
        Info[] mixerInfo = AudioSystem.getMixerInfo();

        if (mixerInfo == null || mixerInfo.length == 0) {
            theMixer = null;
            lineAvailable = false;
            System.out.println("No sound mixer is available!");
            return;
        }

        String mixer = preferredMixer.getValue();
        selected = mixerInfo[0];
        for (Info i : mixerInfo) {
            if (i.getName().equalsIgnoreCase(mixer)) {
                selected = i;
                break;
            }
        }
        theMixer = AudioSystem.getMixer(selected);
//        for (Line l : theMixer.getSourceLines()) {
//            l.close();
//        }
        lineAvailable = true;
    }
SoftMixingMixerProvider.java 文件源码 项目:gervill 阅读 20 收藏 0 点赞 0 评论 0
public Mixer getMixer(Info info) {
    if (!(info == null || info == SoftMixingMixer.info)) {
        throw new IllegalArgumentException("Mixer " + info.toString()
                + " not supported by this provider.");
    }
    synchronized (mutex) {
        if (lockthread != null)
            if (Thread.currentThread() == lockthread)
                throw new IllegalArgumentException("Mixer "
                        + info.toString()
                        + " not supported by this provider.");
        if (globalmixer == null)
            globalmixer = new SoftMixingMixer();
        return globalmixer;
    }

}
AudioRecorder.java 文件源码 项目:elphelvision_netbeans 阅读 21 收藏 0 点赞 0 评论 0
public AudioFormat[] GetMixerCapabilities(int MixerIndex) {
    Info[] mixerinfo = AudioSystem.getMixerInfo();

    // select the Mixer to record from
    Mixer mixer = AudioSystem.getMixer(mixerinfo[MixerIndex]);
    Line.Info[] Infos = mixer.getTargetLineInfo();
    for (int i = 0; i < Infos.length; i++) {
        if (Infos[i] instanceof DataLine.Info) {
            DataLine.Info dataLineInfo = (DataLine.Info) Infos[i];
            // these are the available formats of the selected mixer
            AudioFormat[] supportedFormats = dataLineInfo.getFormats();
            return supportedFormats;
        }
    }
    return null;
}
AudioProtocolParser.java 文件源码 项目:NetHomeServer 阅读 16 收藏 0 点赞 0 评论 0
public String getModel() {
    StringBuilder result = new StringBuilder(MODEL_1);
    for (ProtocolDecoder decoder : decoders.getAllDecoders()) {
        result.append("<item>");
        result.append(decoder.getInfo().getName());
        result.append("</item>");
    }
    result.append(MODEL_2);
    result.append("<item>");
    result.append(getSourceName());
    result.append("</item>");
    for (Info source : audioSampler.getSourceList()) {
        result.append("<item>");
        result.append(source.getName());
        result.append("</item>");
    }
    result.append(MODEL_3);
    return result.toString();
}
AudioProtocolTransmitter.java 文件源码 项目:NetHomeServer 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Specify audio source. This can be specified in two ways, either the
 * source number or by the name of the source. Even if the number is
 * specified, the source name is stored and used.
 *
 * @param name source name or source number
 */
public void setSourceName(String name) {
    Info sources[] = m_PulsePlayer.getSourceList();
    if ((name.length() == 1) &&
            (name.charAt(0) >= '0') &&
            (name.charAt(0) <= '9')) {
        m_PulsePlayer.setSource(Integer.parseInt(name));
    } else {
        for (int i = 0; i < sources.length; i++) {
            if (sources[i].getName().replaceAll("\\s+", " ").equalsIgnoreCase(name)) {
                m_PulsePlayer.setSource(i);
            }
        }
    }
    m_SourceName = sources[m_PulsePlayer.getSource()].getName();
    if (m_PulsePlayer.isOpen()) {
        m_PulsePlayer.closeLine();
        m_PulsePlayer.openLine();
    }
}
TGMixerProvider.java 文件源码 项目:TuxGuitar-1.3.1-fork 阅读 19 收藏 0 点赞 0 评论 0
@Override
public Mixer getMixer(Info info) {
    if( TGMixer.MIXER_INFO.equals(info) ) {
        return new TGMixer();
    }
    return null;
}
GStreamerMixerProvider.java 文件源码 项目:javify 阅读 20 收藏 0 点赞 0 评论 0
@Override
public Mixer getMixer(Info info)
{
  if (info.equals(mixer.getMixerInfo()))
    return mixer;

  throw new
    IllegalArgumentException("This provider cannot handle a mixer or type: "
                             + info.getName());
}
GStreamerMixerProvider.java 文件源码 项目:jvm-stm 阅读 17 收藏 0 点赞 0 评论 0
@Override
public Mixer getMixer(Info info)
{
  if (info.equals(mixer.getMixerInfo())) 
    return mixer;

  throw new
    IllegalArgumentException("This provider cannot handle a mixer or type: "
                             + info.getName());
}
Main.java 文件源码 项目:forplay 阅读 22 收藏 0 点赞 0 评论 0
public static void main(String[] args) throws InterruptedException {
  for (AudioFileFormat.Type fileFormat : AudioSystem.getAudioFileTypes()) {
    System.out.print(fileFormat + ", ");
  }
  System.out.println();

  System.out.println();
  for (Info info : AudioSystem.getMixerInfo()) {
    System.out.println(info);
  }
  System.out.println();

  Mixer mixer = AudioSystem.getMixer(null);
  int maxLines = mixer.getMaxLines(mixer.getLineInfo());
  System.out.println("maxlines=" + maxLines);
  Thread.sleep(100);

  play("35631__reinsamba__crystal_glass.wav");
  play("9874__vixuxx__crow.au");
  play("9874__vixuxx__crow.aiff");
  play("Bird_Black_Ready1.wav");
  play("Bird_Black_Clicked1.mp3");
  play("ambient_construction.mp3");
  play("28917__junggle__btn107.mp3");
  play("forty-two.mp3");
  Thread.sleep(1000);
  System.out.println("Done");
}
SoundMixer.java 文件源码 项目:jace 阅读 18 收藏 0 点赞 0 评论 0
@Override
public LinkedHashMap<? extends String, String> getSelections() {
    Info[] mixerInfo = AudioSystem.getMixerInfo();
    LinkedHashMap<String, String> out = new LinkedHashMap<>();
    for (Info i : mixerInfo) {
        out.put(i.getName(), i.getName());
    }
    return out;
}
MixerProvider.java 文件源码 项目:cn1 阅读 21 收藏 0 点赞 0 评论 0
public boolean isMixerSupported(Mixer.Info info) {
    Mixer.Info[] devices = getMixerInfo();
    for (Info element : devices) {
        if (info.equals(element)) {
            return true;
        }
    }
    return false;
}
GStreamerMixerProvider.java 文件源码 项目:JamVM-PH 阅读 16 收藏 0 点赞 0 评论 0
@Override
public Mixer getMixer(Info info)
{
  if (info.equals(mixer.getMixerInfo())) 
    return mixer;

  throw new
    IllegalArgumentException("This provider cannot handle a mixer or type: "
                             + info.getName());
}


问题


面经


文章

微信
公众号

扫码关注公众号