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


Java Info类代码示例

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


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

示例1: playSync

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public void playSync(String filePath) {
	final File file = new File(filePath);

	try (final AudioInputStream in = getAudioInputStream(file)) {
		final AudioFormat outFormat = getOutFormat(in.getFormat());
		final Info info = new Info(SourceDataLine.class, outFormat);

		try (final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) {
			if (line != null) {
				line.open(outFormat);
				line.start();
				stream(getAudioInputStream(outFormat, in), line);
				line.drain();
				line.stop();
			}
		}
	}
	catch (Exception e) {
		throw new IllegalStateException(e);
	}
}
 
开发者ID:Namek,项目名称:TheConsole_POC,代码行数:22,代码来源:AudioFilePlayer.java

示例2: play

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public void play(InputStream inputStream) {
    stopAll();
    try (final AudioInputStream in = getAudioInputStream(inputStream)) {
        final AudioFormat outFormat = getOutFormat(in.getFormat());
        final Info info = new Info(SourceDataLine.class, outFormat);
        try (final SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info)) {
            if (line != null) {
                lines.add(line);
                line.open(outFormat);
                line.start();
                stream(getAudioInputStream(outFormat, in), line);
                line.drain();
                line.stop();
            }
        }
    } catch (UnsupportedAudioFileException
            | LineUnavailableException
            | IOException exception) {
        throw new IllegalStateException(exception);
    }
}
 
开发者ID:seventhroot,项目名称:harmonic-moon,代码行数:22,代码来源:MusicPlayer.java

示例3: create

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
@ObfuscatedName("w")
@ObfuscatedSignature(
   signature = "(II)V",
   garbageValue = "-629465154"
)
@Export("create")
protected void create(int var1) throws LineUnavailableException {
   try {
      Info var2 = new Info(SourceDataLine.class, this.audioFormat, var1 << (ContextMenuRow.highMemory?2:1));
      this.source = (SourceDataLine)AudioSystem.getLine(var2);
      this.source.open();
      this.source.start();
      this.size = var1;
   } catch (LineUnavailableException var5) {
      int var4 = (var1 >>> 1 & 1431655765) + (var1 & 1431655765);
      var4 = (var4 >>> 2 & 858993459) + (var4 & 858993459);
      var4 = (var4 >>> 4) + var4 & 252645135;
      var4 += var4 >>> 8;
      var4 += var4 >>> 16;
      int var3 = var4 & 255;
      if(var3 != 1) {
         this.create(class173.nextPowerOfTwo(var1));
      } else {
         this.source = null;
         throw var5;
      }
   }
}
 
开发者ID:runelite,项目名称:runelite,代码行数:29,代码来源:SourceDataSoundSystem.java

示例4: AudioPlayer

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public AudioPlayer(File audioFile, ResourceBundle messages) throws IOException {
	this.messages = messages;
	try (AudioInputStream in = AudioSystem.getAudioInputStream(audioFile.toURI().toURL())) {
		this.audioFile = audioFile;

		outFormat = getOutFormat(in.getFormat());
		Info info = new Info(SourceDataLine.class, outFormat);

		line = (SourceDataLine) AudioSystem.getLine(info);
		line.open(outFormat);
	} catch (UnsupportedAudioFileException | LineUnavailableException e) {
		throw new IOException(e);
	}
}
 
开发者ID:MajorTom4711,项目名称:ProfiSounder,代码行数:15,代码来源:AudioPlayer.java

示例5: play

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public void play(String filePath) {
    final File file = new File(filePath);
 
    try (final AudioInputStream in = getAudioInputStream(file)) {
         
        final AudioFormat outFormat = getOutFormat(in.getFormat());
        final Info info = new Info(SourceDataLine.class, outFormat);
 
        try (final SourceDataLine line =
                 (SourceDataLine) AudioSystem.getLine(info)) {
 
            if (line != null) {
                line.open(outFormat);
                line.start(); 
                AudioInputStream inputMystream = AudioSystem.getAudioInputStream(outFormat, in);
                stream(inputMystream, line);
                line.drain();
                line.stop();  
            }
        }
 
    } catch (UnsupportedAudioFileException 
           | LineUnavailableException 
           | IOException e) {
        throw new IllegalStateException(e);
    }
}
 
开发者ID:SaeedMasoumi,项目名称:stupidwarriors,代码行数:28,代码来源:OggPlayer.java

示例6: JavaSoundInDevice

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public JavaSoundInDevice(Mixer mixer, AudioFormat af, Info info,int bufferSizeInFrames) {
	super(mixer, af, info,bufferSizeInFrames);
	framesRead = 0;
	doFlush = true;
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:6,代码来源:JavaSoundInDevice.java

示例7: JavaSoundOutDevice

import javax.sound.sampled.DataLine.Info; //导入依赖的package包/类
public JavaSoundOutDevice(Mixer mixer, AudioFormat af, Info info,int bufferSizeInFrames) {
	super(mixer, af, info, bufferSizeInFrames);
	
	
}
 
开发者ID:petersalomonsen,项目名称:frinika,代码行数:6,代码来源:JavaSoundOutDevice.java


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