类javax.sound.sampled.Mixer.Info源码实例Demo

下面列出了怎么用javax.sound.sampled.Mixer.Info的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码2 项目: TencentKona-8   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码3 项目: jdk8u60   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码4 项目: openjdk-jdk8u   文件: SoftMixingMixerProvider.java
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;
    }

}
 
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;
    }

}
 
源代码6 项目: Bytecoder   文件: SoftMixingMixerProvider.java
@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;
    }
}
 
源代码7 项目: openjdk-jdk9   文件: SoftMixingMixerProvider.java
@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;
    }
}
 
源代码8 项目: jdk8u-jdk   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码9 项目: hottub   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码10 项目: openjdk-8-source   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码11 项目: openjdk-8   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码12 项目: jdk8u_jdk   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码13 项目: jdk8u-jdk   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码14 项目: jdk8u-dev-jdk   文件: SoftMixingMixerProvider.java
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;
    }

}
 
源代码15 项目: jace   文件: SoundMixer.java
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;
    }
 
protected void firstFrame() {
		// load assets
		audioSample = FileUtil.fileFromPath(FileUtil.getPath("audio/kit808/snare.wav"));
		
		// store audio lines
		linesOut = new ArrayList<Line.Info>();
		mixers = new ArrayList<Mixer>();
		
		// beads
//		audioContext = new AudioContext();
//		audioContext.postAudioFormatInfo();
//		P.out("audioContext.out.getOuts()", audioContext.out.getOuts());
//		audioContext.start();

		printAllMixerNames();
		P.out("=============");
		getDeviceInfos("");
	}
 
源代码17 项目: tuxguitar   文件: TGMixerProvider.java
@Override
public Mixer getMixer(Info info) {
	if( TGMixer.MIXER_INFO.equals(info) ) {
		return new TGMixer();
	}
	return null;
}
 
源代码18 项目: gama   文件: BasicPlayer.java
public List<String> getMixers() {
	final ArrayList<String> mixers = new ArrayList<>();
	final Mixer.Info[] mInfos = AudioSystem.getMixerInfo();
	if (mInfos != null) {
		for (final Info mInfo : mInfos) {
			final Line.Info lineInfo = new Line.Info(SourceDataLine.class);
			final Mixer mixer = AudioSystem.getMixer(mInfo);
			if (mixer.isLineSupported(lineInfo)) {
				mixers.add(mInfo.getName());
			}
		}
	}
	return mixers;
}
 
源代码19 项目: gama   文件: BasicPlayer.java
public Mixer getMixer(final String name) {
	Mixer mixer = null;
	if (name != null) {
		final Mixer.Info[] mInfos = AudioSystem.getMixerInfo();
		if (mInfos != null) {
			for (final Info mInfo : mInfos) {
				if (mInfo.getName().equals(name)) {
					mixer = AudioSystem.getMixer(mInfo);
					break;
				}
			}
		}
	}
	return mixer;
}
 
源代码20 项目: jace   文件: SoundMixer.java
@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;
}
 
protected void printAllMixerNames() {
    for(Mixer.Info info : AudioSystem.getMixerInfo()) {
        P.out(info.getName(), " - ", info.getDescription());
		Mixer m = AudioSystem.getMixer(info);
		mixers.add(m);
		UI.addButton(info.getName(), false);
    }
}
 
protected void buildLinesFromCurMixer() {
	Line.Info[] sourceInfos = curMixer().getSourceLineInfo();
	for (int s = 0; s < sourceInfos.length; s++) {
		P.out("=========================");
		Line.Info lineInfo = sourceInfos[s];
		linesOut.add(lineInfo);
		P.out("    info: " + lineInfo);
		try {
			Line line = AudioSystem.getLine(lineInfo);
			if (line instanceof SourceDataLine) {
				Arrays.asList(((DataLine.Info) line.getLineInfo()).getFormats()).forEach(format -> {
					P.out("#######");
					P.out("Channels: " + format.getChannels());
					P.out("Size in Bits: " + format.getSampleSizeInBits());
					P.out("Frame Rate: " + format.getFrameRate());
					P.out("Frame Size: " + format.getFrameSize());
					P.out("Encoding: " + format.getEncoding());
					P.out("Sample Rate: " + format.getSampleRate());

				});
			}
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		P.out("=========================");
	}
}
 
protected Clip clipFromDefault() {
	try {
    	Line.Info lineInfo = new Line.Info(Clip.class);
    	Line line = AudioSystem.getLine(lineInfo);
        Clip clip = (Clip)line;
		return clip;
	} catch (LineUnavailableException e) {
		e.printStackTrace();
		return null;
	}
}
 
protected Clip clipFromLine() {
	try {
		// did this even work??
		int lineIndex = UI.valueInt(LINE_INDEX);
		lineIndex = P.constrain(lineIndex, 0, linesOut.size() - 1);
		Line.Info lineInfo = linesOut.get(lineIndex);
    	Line line = AudioSystem.getLine(lineInfo);
        Clip clip = (Clip)line;

		return clip;
	} catch (LineUnavailableException e) {
		e.printStackTrace();
		return null;
	}
}
 
源代码25 项目: dragonwell8_jdk   文件: SoftMixingMixerProvider.java
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}
 
源代码26 项目: TencentKona-8   文件: SoftMixingMixerProvider.java
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}
 
源代码27 项目: jdk8u60   文件: SoftMixingMixerProvider.java
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}
 
源代码28 项目: openjdk-jdk8u   文件: SoftMixingMixerProvider.java
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}
 
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}
 
源代码30 项目: Bytecoder   文件: SoftMixingMixerProvider.java
@Override
public Info[] getMixerInfo() {
    return new Info[] { SoftMixingMixer.info };
}