本文整理汇总了Java中org.andengine.audio.sound.Sound类的典型用法代码示例。如果您正苦于以下问题:Java Sound类的具体用法?Java Sound怎么用?Java Sound使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Sound类属于org.andengine.audio.sound包,在下文中一共展示了Sound类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public Sound getSound(String soundName) {
final Sound sound = soundMap.get(soundName);
if (sound != null) {
Log.v(TAG, "getSound - returning Sound " + soundName);
} else {
Log.v(TAG, "getSound - missing Sound " + soundName);
}
return sound;
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:10,代码来源:AbstractGameActivity.java
示例2: loadLocale
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
private void loadLocale(ProgressDisplay progress) throws IOException {
// Initialize game shell textures
Texture newShell = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, this.locale.shell_src);
newShell.load();
GameUI.init(newShell);
// For storing sound data
blockSounds = new HashMap<String, Sound>();
// Load background music
try {
this.music = MusicFactory.createMusicFromAsset(PhoeniciaContext.musicManager, PhoeniciaContext.context, locale.music_src);
this.music.setLooping(true);
this.music.setVolume(0.3f);
} catch (Exception e) {
Debug.e("Failed to load background music asset: "+locale.music_src);
}
progress.setProgress(0.3f);
this.loadLocaleMap();
progress.setProgress(0.4f);
this.loadLocaleDefaults();
this.loadLocalePeople();
progress.setProgress(0.5f);
this.loadLocaleTour();
progress.setProgress(0.6f);
this.loadLocaleNumbers();
progress.setProgress(0.65f);
this.loadLocaleLetters();
progress.setProgress(0.7f);
this.loadLocaleWords();
progress.setProgress(0.8f);
this.loadLocaleGames();
progress.setProgress(0.9f);
this.loadLocaleDecorations();
this.loadLocaleLevels();
progress.setProgress(0.99f);
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:39,代码来源:PhoeniciaGame.java
示例3: loadSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
private void loadSound(SoundAsset soundAsset) {
try {
SoundFactory.setAssetBasePath("mfx/");
Sound sound = SoundFactory.createSoundFromAsset(getEngine().getSoundManager(), getApplicationContext(), soundAsset.getFilename());
sound.setVolume(soundAsset.getVolume(), soundAsset.getVolume());
soundMap.put(soundAsset.getFilename(), sound);
} catch (IOException e) {
e.printStackTrace();
}
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:11,代码来源:AbstractGameActivity.java
示例4: getInstance
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public static MediaManager getInstance(BaseGameActivity pBaseActivity) {
if (self == null) {
self = new MediaManager();
MediaManager.mBaseActivity = pBaseActivity;
MediaManager.mMusicArray = new SparseArray<Music>();
MediaManager.mSoundArray = new SparseArray<Sound>();
}
return self;
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:10,代码来源:MediaManager.java
示例5: get
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
private Sound get(SoundType pSoundType) {
Sound sound = mSoundArray.get(pSoundType.getValue());
// 未生成, 解放済み
if (sound == null) {
throw new RuntimeException("not create pSoundType = " + pSoundType);
}
if (sound.isReleased()) {
throw new RuntimeException("released pSoundType = " + pSoundType);
}
return sound;
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:12,代码来源:MediaManager.java
示例6: playSoundLoop
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public static void playSoundLoop(Sound s) {
if(s != null && s.isLoaded()) {
s.setVolume(getSoundVolume());
s.setLooping(true);
s.play();
}
}
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:8,代码来源:SFXManager.java
示例7: init
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public static void init() throws IOException {
GameSounds.sounds = new HashMap<String, Sound>();
GameSounds.sounds.put(COLLECT, SoundFactory.createSoundFromAsset(PhoeniciaContext.soundManager, PhoeniciaContext.context, COLLECT));
GameSounds.sounds.put(COMPLETE, SoundFactory.createSoundFromAsset(PhoeniciaContext.soundManager, PhoeniciaContext.context, COMPLETE));
GameSounds.sounds.put(FAILED, SoundFactory.createSoundFromAsset(PhoeniciaContext.soundManager, PhoeniciaContext.context, FAILED));
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:7,代码来源:GameSounds.java
示例8: putSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public void putSound(String soundName, Sound sound) {
soundMap.put(soundName, sound);
Log.v(TAG, "putSound - Added Sound " + soundName);
}
开发者ID:PLNech,项目名称:BactMan-Adventures,代码行数:5,代码来源:AbstractGameActivity.java
示例9: play
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public void play(SoundType pSoundType) {
Sound sound = get(pSoundType);
// 再生する
sound.play();
}
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:6,代码来源:MediaManager.java
示例10: playSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public static void playSound(Sound s) {
if(s != null && s.isLoaded()) {
s.setVolume(getSoundVolume());
s.play();
}
}
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:7,代码来源:SFXManager.java
示例11: stopSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
public static void stopSound(Sound s) {
if(s != null && s.isLoaded()) {
s.stop();
}
}
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:6,代码来源:SFXManager.java
示例12: playSound
import org.andengine.audio.sound.Sound; //导入依赖的package包/类
private void playSound(Sound sound) {
if (sound != null && sound.isLoaded() && !sound.isReleased()) {
sound.play();
}
}
开发者ID:delight-im,项目名称:NationSoccer,代码行数:6,代码来源:GameScene.java
注:本文中的org.andengine.audio.sound.Sound类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论