当前位置: 首页>>代码示例>>Java>>正文


Java Info类代码示例

本文整理汇总了Java中javax.sound.sampled.Mixer.Info的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Info类属于javax.sound.sampled.Mixer包,在下文中一共展示了Info类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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;
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:SoftMixingMixerProvider.java

示例2: getMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:SoftMixingMixerProvider.java

示例3: main

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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");
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:23,代码来源:Main.java

示例4: getMixerInfo

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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;
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:18,代码来源:Shared.java

示例5: initMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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;
    }
 
开发者ID:badvision,项目名称:jace,代码行数:26,代码来源:SoundMixer.java

示例6: GetMixerCapabilities

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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;
}
 
开发者ID:apertus-open-source-cinema,项目名称:elphelvision_eclipse,代码行数:17,代码来源:AudioRecorder.java

示例7: getModel

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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();
}
 
开发者ID:stefangs,项目名称:NetHomeServer,代码行数:20,代码来源:AudioProtocolParser.java

示例8: setSourceName

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:stefangs,项目名称:NetHomeServer,代码行数:27,代码来源:AudioProtocolTransmitter.java

示例9: getMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@Override
public Mixer getMixer(Info info) {
	if( TGMixer.MIXER_INFO.equals(info) ) {
		return new TGMixer();
	}
	return null;
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:8,代码来源:TGMixerProvider.java

示例10: getMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@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());
}
 
开发者ID:vilie,项目名称:javify,代码行数:11,代码来源:GStreamerMixerProvider.java

示例11: getMixer

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@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());
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:11,代码来源:GStreamerMixerProvider.java

示例12: main

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
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");
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:29,代码来源:Main.java

示例13: getSelections

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@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;
}
 
开发者ID:badvision,项目名称:jace,代码行数:10,代码来源:SoundMixer.java

示例14: isMixerSupported

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
public boolean isMixerSupported(Mixer.Info info) {
    Mixer.Info[] devices = getMixerInfo();
    for (Info element : devices) {
        if (info.equals(element)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:MixerProvider.java

示例15: getMenu

import javax.sound.sampled.Mixer.Info; //导入依赖的package包/类
@Override
public JMenu getMenu() {
	final JMenu retVal = new JMenu();

	if(getWavDisplay().isPlaying()) {
		retVal.add(new StopAction(getEditor(), this));
	} else {
		retVal.add(new PlayAction(getEditor(), this));
		final JCheckBoxMenuItem loopItem = new JCheckBoxMenuItem(new ToggleLoop(getWavDisplay()));
		retVal.add(loopItem);

		// output device selection
		final JMenu mixerMenu = new JMenu("Output Device");
		final Info[] mixers = AudioSystem.getMixerInfo();
		for(Info mixerInfo:mixers) {
			// if we have no source lines, we can't use this device
			if(AudioSystem.getMixer(mixerInfo).getSourceLineInfo().length == 0) continue;
			final SelectMixerAction mixerAct = new SelectMixerAction(getWavDisplay(), mixerInfo);
			mixerAct.putValue(SelectMixerAction.SELECTED_KEY,
					getWavDisplay().getMixerInfo() == mixerInfo);
			mixerMenu.add(new JCheckBoxMenuItem(mixerAct));
		}
		retVal.add(mixerMenu);
	}
	retVal.addSeparator();
	retVal.add(new ResetAction(getEditor(), this));
	retVal.add(new ZoomAction(getEditor(), this));
	retVal.add(new ZoomAction(getEditor(), this, false));
	retVal.addSeparator();
	retVal.add(new SaveAction(getEditor(), this));
	retVal.add(new GenerateAction(getEditor(), this));

	for(SpeechAnalysisTier tier:pluginTiers) {
		tier.addMenuItems(retVal, false);
	}

	return retVal;
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:39,代码来源:SpeechAnalysisEditorView.java


注:本文中的javax.sound.sampled.Mixer.Info类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。