本文整理了Java中javax.sound.sampled.Mixer.getMixerInfo()
方法的一些代码示例,展示了Mixer.getMixerInfo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mixer.getMixerInfo()
方法的具体详情如下:
包路径:javax.sound.sampled.Mixer
类名称:Mixer
方法名:getMixerInfo
暂无
代码示例来源:origin: tulskiy/musique
public Mixer.Info getMixer() {
if (mixer != null)
return mixer.getMixerInfo();
else
return null;
}
代码示例来源:origin: IanWraith/DMRDecode
/**
* Get the MixerInfo based on the mixer name
* @param mixerName
* @return
*/
public Mixer.Info getMixerInfo(String mixerName){
Mixer.Info mixers[]=AudioSystem.getMixerInfo();
//iterate the mixers and display TargetLines
for (int i=0; i< mixers.length; i++){
Mixer m=AudioSystem.getMixer(mixers[i]);
// Ensure that only sound capture devices can be selected
boolean isCaptureDevice=m.getMixerInfo().getDescription().endsWith("Capture");
if ((m.getMixerInfo().getName().equals(mixerName))&&(isCaptureDevice==true)){
return m.getMixerInfo();
}
}
//if no mixer found, returns null which is the default mixer on the machine
return null;
}
代码示例来源:origin: com.googlecode.soundlibs/tritonus-share
public Mixer.Info[] getMixerInfo()
{
if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): begin"); }
Set<Mixer.Info> mixerInfos = new HashSet<Mixer.Info>();
MixerProviderStruct struct = getMixerProviderStruct();
synchronized (struct)
{
Iterator<Mixer> mixers = struct.m_mixers.iterator();
while (mixers.hasNext())
{
Mixer mixer = mixers.next();
mixerInfos.add(mixer.getMixerInfo());
}
}
if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): end"); }
return mixerInfos.toArray(EMPTY_MIXER_INFO_ARRAY);
}
代码示例来源:origin: pdudits/soundlibs
public Mixer.Info[] getMixerInfo()
{
if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): begin"); }
Set<Mixer.Info> mixerInfos = new HashSet<Mixer.Info>();
MixerProviderStruct struct = getMixerProviderStruct();
synchronized (struct)
{
Iterator<Mixer> mixers = struct.m_mixers.iterator();
while (mixers.hasNext())
{
Mixer mixer = mixers.next();
mixerInfos.add(mixer.getMixerInfo());
}
}
if (TDebug.TraceMixerProvider) { TDebug.out("TMixerProvider.getMixerInfo(): end"); }
return mixerInfos.toArray(EMPTY_MIXER_INFO_ARRAY);
}
代码示例来源:origin: IanWraith/DMRDecode
public String getMixerName() {
return audioMixer.getMixer().getMixerInfo().getName();
}
代码示例来源:origin: net.sf.phat/phat-audio
private SourceDataLine getSourceDataLine(DataLine.Info dataLineInfo) {
SourceDataLine sdl = null;
for (Mixer.Info mi : AudioSystem.getMixerInfo()) {
Mixer m = AudioSystem.getMixer(mi);
if (m.isLineSupported(dataLineInfo)) {
try {
Line line = m.getLine(dataLineInfo);
if (line instanceof SourceDataLine) {
Logger.getLogger(
PCSpeaker.class.getName()).log(Level.INFO, "Mixer={0}", m.getMixerInfo().getName());
sdl = (SourceDataLine) line;
break;
}
} catch (LineUnavailableException ex) {
Logger.getLogger(PCSpeaker.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
return sdl;
}
代码示例来源:origin: stackoverflow.com
System.out.printf("Supported SourceDataLines of default mixer (%s):\n\n", mixer.getMixerInfo().getName());
for(Line.Info info : mixer.getSourceLineInfo()) {
if(SourceDataLine.class.isAssignableFrom(info.getLineClass())) {
代码示例来源:origin: robo-code/robocode
/**
* Adds a number of clip clones for a given resource holding the audio data.
* If there is any error, the method returns silently, and clip instances will
* not be found later for the provided key.
*
* @param key the key to be used for later retrieval of the sound
* @param resourceName the resource holding the audio data
* @param numClones the number of copies of the clip to be created
*/
public void addSound(Object key, String resourceName, int numClones) {
if (mixer == null || resourceName == null || (resourceName.trim().length() == 0)) {
return;
}
SoundData data = createSoundData(resourceName);
if (data == null) {
return;
}
ClipClones clones;
try {
clones = new ClipClones(mixer, data, numClones);
soundTable.put(key, clones);
} catch (LineUnavailableException e) {
Logger.logError(
"The audio mixer " + mixer.getMixerInfo().getName()
+ " does not support the audio format of the sound clip: " + resourceName);
}
}
代码示例来源:origin: pdudits/soundlibs
if (mixer.getMixerInfo().equals(info))
代码示例来源:origin: com.googlecode.soundlibs/tritonus-share
if (mixer.getMixerInfo().equals(info))
代码示例来源:origin: com.github.nifty-gui/nifty-pauls-soundsystem
try
mixerRanker.rank( m.getMixerInfo() );
代码示例来源:origin: com.pippsford/SecurePRNG-core
AudioFormat af = format.getFormats()[0];
if (LOG.isDebugEnabled()) {
LOG.debug("Sampling audio from {}({}) at {} Hz", mixer.getMixerInfo().getName(), mixer.getMixerInfo().getDescription(), af.getSampleRate());
代码示例来源:origin: stackoverflow.com
System.out.println("Got TargetDataLine from :" + targetMixer.getMixerInfo().getName());
return;
代码示例来源:origin: stackoverflow.com
portMixer = getPortMixerInfoFor(mi);
if (portMixer != null) {
System.out.println(portMixer.getMixerInfo().toString());
targetMixer = AudioSystem.getMixer(mi);
break;
System.out.println("Got TargetDataLine from :" + targetMixer.getMixerInfo().getName());
代码示例来源:origin: IanWraith/DMRDecode
Mixer.Info mInfo=mx.getMixerInfo();
errorMsg=errorMsg+"\nMixer Name : "+mInfo.getName()+"\nMixer Description : "+mInfo.getDescription();
代码示例来源:origin: tulskiy/musique
if (mixer != null && mixer.isLineSupported(info)) {
line = (SourceDataLine) mixer.getLine(info);
logger.fine("Mixer: " + mixer.getMixerInfo().getDescription());
} else {
line = AudioSystem.getSourceDataLine(fmt);
内容来源于网络,如有侵权,请联系作者删除!