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


Java Applet.newAudioClip方法代码示例

本文整理汇总了Java中java.applet.Applet.newAudioClip方法的典型用法代码示例。如果您正苦于以下问题:Java Applet.newAudioClip方法的具体用法?Java Applet.newAudioClip怎么用?Java Applet.newAudioClip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.applet.Applet的用法示例。


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

示例1: playApplet

import java.applet.Applet; //导入方法依赖的package包/类
private static void playApplet(String filename) {
	URL url = null;
	try {
		File file = new File(filename);
		if (file.canRead())
			url = file.toURI().toURL();
	} catch (MalformedURLException e) {
		throw new IllegalArgumentException("could not play '" + filename + "'", e);
	}

	// URL url = StdAudio.class.getResource(filename);
	if (url == null) {
		throw new IllegalArgumentException("could not play '" + filename + "'");
	}

	AudioClip clip = Applet.newAudioClip(url);
	clip.play();
}
 
开发者ID:Scoutdrago3,项目名称:MusicToGraph,代码行数:19,代码来源:StdAudio.java

示例2: reproducirSonidoJuego

import java.applet.Applet; //导入方法依赖的package包/类
public void reproducirSonidoJuego(){
    URL url = getClass().getResource("juego.mid");
    clipJuego = Applet.newAudioClip(url);
    clipJuego.loop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例3: getAudio

import java.applet.Applet; //导入方法依赖的package包/类
public static AudioClip getAudio(int index) {
	if (audios[index] == null) {
		URL url = null;
		ClassLoader classLoader = FileHelper.class.getClassLoader();
		url = classLoader.getResource("music/" + index + ".wav");
		audios[index] = Applet.newAudioClip(url);
	}
	return audios[index];
}
 
开发者ID:zhangjikai,项目名称:LinkGame,代码行数:10,代码来源:EffectSound.java

示例4: playAudio

import java.applet.Applet; //导入方法依赖的package包/类
public void playAudio(int tempo, boolean flag) throws UnsupportedAudioFileException, LineUnavailableException, IOException, InterruptedException{
    Clip clip = AudioSystem.getClip();
    URL url = getClass().getResource("/audio/smb_die.wav");
    URL urlToHot = this.getClass().getResource("/audio/smb_die.wav");
    System.out.println(urlToHot);
    this.audio = Applet.newAudioClip(url);
    if(flag) audio.loop();
    else audio.stop();
    
}
 
开发者ID:knowrafa,项目名称:lembredio,代码行数:11,代码来源:Audio.java

示例5: createAudioClipFactory

import java.applet.Applet; //导入方法依赖的package包/类
protected AudioClipFactory createAudioClipFactory() {
  return new AudioClipFactory() {
    public AudioClip getAudioClip(URL url) {
      return Applet.newAudioClip(url);
    }
  };
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:8,代码来源:SoundConfigurer.java

示例6: Sound

import java.applet.Applet; //导入方法依赖的package包/类
private Sound(String name) {
  try {
		clip = Applet.newAudioClip( Sound.class
				  .getResource( name ) ); //tries to load the audio clip from the name you gave above.
  } catch ( Throwable e ) {
		e.printStackTrace( ); // else it will throw an error
  }
}
 
开发者ID:BrianGaucher,项目名称:Camasia,代码行数:9,代码来源:Sound.java

示例7: doLoadSounds

import java.applet.Applet; //导入方法依赖的package包/类
/**
 * Method description
 * 
 * @see
 */
final private void doLoadSounds() {
	switch (this.bytGprogramType) {
		case Constants.bytS_STATE_PROGRAM_LOCAL_APPLICATION:
			this.objGapplicationClipAA = new ExtendedClip[Constants.bytS_FILES_SOUNDS_NUMBER][Constants.bytS_ENGINE_SOUNDS_BUFFERING];
			for (byte bytLsoundFileIndex = 0; bytLsoundFileIndex < Constants.bytS_FILES_SOUNDS_NUMBER; ++bytLsoundFileIndex) {
				for (byte bytLbufferingIndex = 0; bytLbufferingIndex < Constants.bytS_ENGINE_SOUNDS_BUFFERING; ++bytLbufferingIndex) {
					this.objGapplicationClipAA[bytLsoundFileIndex][bytLbufferingIndex] = new ExtendedClip(this, bytLsoundFileIndex);
				}
			}
			break;

		case Constants.bytS_STATE_PROGRAM_LOCAL_APPLET:
		case Constants.bytS_STATE_PROGRAM_WEB_APPLET:
			this.objGappletAudioClipA = new AudioClip[Constants.bytS_FILES_SOUNDS_NUMBER];
			for (byte bytLsoundFileIndex = 0; bytLsoundFileIndex < Constants.bytS_FILES_SOUNDS_NUMBER; ++bytLsoundFileIndex) {
				try {
					this.objGappletAudioClipA[bytLsoundFileIndex] =
																	Applet.newAudioClip(new URL(Strings.doConcat(	this.strS_CODE_BASE,
																													Constants.strS_FILE_NAME_A[Constants.intS_FILE_FOLDER_SOUNDS],
																													this.chrGpathSeparator,
																													Constants.strS_FILE_SOUND_NAME_A[bytLsoundFileIndex])));
				} catch (final Throwable objPthrowable) {
					Tools.err("Error while initializing sound");
					this.objGappletAudioClipA[bytLsoundFileIndex] = null;
				}
			}
			break;
	}
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:35,代码来源:JuggleMasterPro.java

示例8: EfectosSonido

import java.applet.Applet; //导入方法依赖的package包/类
public EfectosSonido(){
    URL url = getClass().getResource("laser.WAV");
    clipShoot = Applet.newAudioClip(url);
    url = getClass().getResource("explosion.wav");
    clipExplosion = Applet.newAudioClip(url);
    url = getClass().getResource("Beep.WAV");
    clipClick = Applet.newAudioClip(url);
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:9,代码来源:EfectosSonido.java

示例9: reproducirSonidoMenu

import java.applet.Applet; //导入方法依赖的package包/类
public void reproducirSonidoMenu(){
    URL url = getClass().getResource("menu.mid");
    clipMenu = Applet.newAudioClip(url);  
    clipMenu.loop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例10: pararSonidoMenu

import java.applet.Applet; //导入方法依赖的package包/类
public void pararSonidoMenu(){
    URL url = getClass().getResource("menu.mid");
    clipMenu = Applet.newAudioClip(url);
    clipMenu.stop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例11: pararSonidoJuego

import java.applet.Applet; //导入方法依赖的package包/类
public void pararSonidoJuego(){
    URL url = getClass().getResource("juego.mid");
    clipJuego = Applet.newAudioClip(url);
    clipJuego.stop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例12: reproducirSonidoAcelerar

import java.applet.Applet; //导入方法依赖的package包/类
public void reproducirSonidoAcelerar(){
    URL url = getClass().getResource("Acelerar.wav");
    clipAcelerar = Applet.newAudioClip(url);
    clipAcelerar.play();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例13: pararSonidoAcelerar

import java.applet.Applet; //导入方法依赖的package包/类
public void pararSonidoAcelerar(){
    URL url = getClass().getResource("Acelerar.wav");
    clipAcelerar = Applet.newAudioClip(url);
    clipAcelerar.stop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例14: reproducirSonidoTomarEnergia

import java.applet.Applet; //导入方法依赖的package包/类
public void reproducirSonidoTomarEnergia(){
    URL url = getClass().getResource("EnergyTake.wav");
    clipEnergy = Applet.newAudioClip(url);
    clipEnergy.play();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java

示例15: pararSonidoTomarEnergia

import java.applet.Applet; //导入方法依赖的package包/类
public void pararSonidoTomarEnergia(){
    URL url = getClass().getResource("EnergyTake.wav");
    clipEnergy = Applet.newAudioClip(url);
    clipEnergy.stop();
}
 
开发者ID:Uminks,项目名称:Star-Ride--RiverRaid,代码行数:6,代码来源:EfectosSonido.java


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