Tabnine Logo
Sound.play
Code IndexAdd Tabnine to your IDE (free)

How to use
play
method
in
com.badlogic.gdx.audio.Sound

Best Java code snippets using com.badlogic.gdx.audio.Sound.play (Showing top 20 results out of 315)

origin: libgdx/libgdx

@Override
public void create () {
  Gdx.audio.newSound(Gdx.files.internal("data/tic.ogg")).play();
}
origin: libgdx/libgdx

  public void clicked (InputEvent event, float x, float y) {
    soundId = sound.play(volume.getValue());
    sound.setPitch(soundId, pitch.getValue());
    sound.setPan(soundId, pan.getValue(), volume.getValue());
  }
});
origin: com.harium.etyl/etyl-gdx

public void play() {
  if (sound == null) {
    return;
  }
  sound.play();
}
origin: jsjolund/GdxDemo3D

@Override
public Status execute() {
  GameScreen.screen.sounds.whine.play();
  return Status.SUCCEEDED;
}
origin: BrentAureli/SuperMario

@Override
public void hitOnHead(Mario mario) {
  setToDestroy = true;
  MarioBros.manager.get("audio/sounds/stomp.wav", Sound.class).play();
}
origin: manuelbua/uracer-kotd

  @Override
  public void clicked (InputEvent event, float x, float y) {
    Sounds.menuClick.play();
    URacer.Game.show(ScreenType.OptionsScreen);
  }
});
origin: manuelbua/uracer-kotd

  @Override
  public void clicked (InputEvent event, float x, float y) {
    Sounds.menuClick.play();
    URacer.Game.show(ScreenType.MainScreen);
  }
});
origin: manuelbua/uracer-kotd

  @Override
  public void clicked (InputEvent event, float x, float y) {
    Sounds.menuClick.play();
    URacer.Game.quit();
  }
});
origin: jsjolund/GdxDemo3D

  private static Sound load(String file) {
    Sound sound = Gdx.audio.newSound(Gdx.files.internal(file));
    sound.play(0); // this should force loading on Android, so avoiding the wait on first play in game
    return sound;
  }
}
origin: dsaltares/libgdx-cookbook

  private void play() {
    id = data.getSound().play();
    startTime = TimeUtils.millis();
  }
}
origin: net.mostlyoriginal.artemis-odb/contrib-jam

public void playSfx(String name) {
  if (sfxVolume > 0) {
    Sound sfx = getSfx(name);
    if (sfx != null) {
      sfx.stop();
      sfx.play(sfxVolume, MathUtils.random(1f, 1.04f), 0);
    }
  }
}
origin: manuelbua/uracer-kotd

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    Sounds.menuRollover.play();
    UserPreferences.bool(Preference.EarthCurvature, ((CheckBox)actor).isChecked());
    UserPreferences.save();
  }
});
origin: manuelbua/uracer-kotd

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    Sounds.menuRollover.play();
    UserPreferences.bool(Preference.ZoomRadialBlur, ((CheckBox)actor).isChecked());
    UserPreferences.save();
  }
});
origin: dsaltares/libgdx-cookbook

  @Override
  public boolean touchDown (int screenX, int screenY, int pointer, int button) {
    Sound sound = sounds.get(Keys.NUM_1 + MathUtils.random(sounds.size - 1));
    sound.play();
    
    Gdx.app.log("SoundEffectSample", "Playing sound");
    return true;
  }
}
origin: manuelbua/uracer-kotd

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    Sounds.menuRollover.play();
    UserPreferences.bool(Preference.Vignetting, ((CheckBox)actor).isChecked());
    UserPreferences.save();
  }
});
origin: manuelbua/uracer-kotd

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    Sounds.menuRollover.play();
    UserPreferences.bool(Preference.Ssao, ((CheckBox)actor).isChecked());
    UserPreferences.save();
  }
});
origin: DaanVanYperen/artemis-odb-contrib

public void playSfx(String name) {
  if (sfxVolume > 0) {
    Sound sfx = getSfx(name);
    if (sfx != null) {
      sfx.stop();
      sfx.play(sfxVolume, MathUtils.random(1f, 1.04f), 0);
    }
  }
}
origin: BrentAureli/SuperMario

@Override
public void onHeadHit(Mario mario) {
  if(mario.isBig()) {
    setCategoryFilter(MarioBros.DESTROYED_BIT);
    getCell().setTile(null);
    Hud.addScore(200);
    MarioBros.manager.get("audio/sounds/breakblock.wav", Sound.class).play();
  }
  MarioBros.manager.get("audio/sounds/bump.wav", Sound.class).play();
}
origin: manuelbua/uracer-kotd

  @Override
  public void changed (ChangeEvent event, Actor actor) {
    Sounds.menuRollover.play();
    @SuppressWarnings("unchecked")
    int index = ((SelectBox<String>)actor).getSelectedIndex();
    UserPreferences.string(Preference.TimeDilateInputMode, TimeDilateInputMode.values()[index].toString());
    UserPreferences.save();
  }
});
origin: BrentAureli/SuperMario

public void grow(){
  if( !isBig() ) {
    runGrowAnimation = true;
    marioIsBig = true;
    timeToDefineBigMario = true;
    setBounds(getX(), getY(), getWidth(), getHeight() * 2);
    MarioBros.manager.get("audio/sounds/powerup.wav", Sound.class).play();
  }
}
com.badlogic.gdx.audioSoundplay

Javadoc

Plays the sound. If the sound is already playing, it will be played again, concurrently.

Popular methods of Sound

  • stop
    Stops the sound instance with the given id as returned by #play() or #play(float). If the sound is n
  • dispose
    Releases all the resources.
  • loop
    Plays the sound, looping. If the sound is already playing, it will be played again, concurrently. Yo
  • setVolume
    Changes the volume of the sound instance with the given id as returned by #play() or #play(float). I
  • pause
    Pauses the sound instance with the given id as returned by #play() or #play(float). If the sound is
  • resume
    Resumes the sound instance with the given id as returned by #play() or #play(float). If the sound is
  • setPitch
    Changes the pitch multiplier of the sound instance with the given id as returned by #play() or #play
  • setPan
    Sets the panning and volume of the sound instance with the given id as returned by #play() or #play(
  • setLooping
    Sets the sound instance with the given id to be looping. If the sound is no longer playing this has

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • String (java.lang)
  • BoxLayout (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Option (scala)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now