Examples of Sound


Examples of org.bukkit.Sound

        }

        @Override
        public void verify(ChangedSign sign) throws ICVerificationException {

            Sound sound = null;
            try {
                sound = Sound.valueOf(sign.getLine(3).trim());
            } catch(Exception e) {
            }
            if(sound == null && sign.getLine(3).trim().length() == 15) {
View Full Code Here

Examples of org.bukkit.Sound

        setHealth(health - amount);
        playEffect(EntityEffect.HURT);

        // play sounds, handle death
        if (health <= 0.0) {
            Sound deathSound = getDeathSound();
            if (deathSound != null) {
                world.playSound(location, deathSound, 1.0f, 1.0f);
            }
            // todo: drop items
        } else {
            Sound hurtSound = getHurtSound();
            if (hurtSound != null) {
                world.playSound(location, hurtSound, 1.0f, 1.0f);
            }
        }
    }
View Full Code Here

Examples of org.bukkit.Sound

    float pitch = (float) ToneUtil.midiToPitch(message);
    float volume = VOLUME_RANGE * (message.getData2() / 127.0f);

    // get the correct instrument
    Integer patch = channelPatches.get(message.getChannel());
    Sound instrument = Sound.NOTE_PIANO;
    if (patch != null) instrument = MidiUtil.patchToInstrument(patch);

    for (Player player : listeners)
      player.playSound(player.getLocation(), instrument, volume, pitch);
  }
View Full Code Here

Examples of org.jouvieje.fmodex.Sound

    class FmodSound implements org.open2jam.sound.Sound {
   
        private Sound sound;
       
        public FmodSound(ByteBuffer buffer) throws SoundSystemException {
            sound = new Sound();
            FMOD_CREATESOUNDEXINFO exinfo = FMOD_CREATESOUNDEXINFO.allocate();
            exinfo.setLength(buffer.capacity());
            errorCheck(system.createSound(buffer, FMOD_MODE.FMOD_SOFTWARE | FMOD_MODE.FMOD_OPENMEMORY, exinfo, sound));
        }
View Full Code Here

Examples of org.newdawn.slick.Sound

   * @param filename filename of sound
   * @return handle to sound
   */
  public SoundHandle loadSound(final SoundSystem soundSystem, final String filename) {
    try {
      return new SlickSoundHandle(soundSystem, new Sound(filename));
    } catch (SlickException e) {
      log.warning("loading of '" + filename + "' failed" + e);
    }
    return null;
  }
View Full Code Here

Examples of org.newdawn.slick.Sound

  @Override
  protected void added(Entity e) {
    SoundFile soundFile = soundMapper.get(e);

    try {
      Sound sound = new Sound(soundFile.getSoundFile());
      sound.play(1, 0.3f);
    } catch (SlickException e1) {
      e1.printStackTrace();
    }
  }
View Full Code Here

Examples of org.newdawn.slick.Sound

    if (s == null)
      return null;
    if (!(s instanceof Sound)) {
      String file = s.toString();
      try {
        s = new Sound(file);
      } catch (SlickException e) {
        e.printStackTrace();
        s = null;
      }
      soundMap.put(name, s);
View Full Code Here

Examples of org.newdawn.slick.Sound

      e.printStackTrace();
    }
  }

  public void playSound(String name) {
    Sound s = getSound(name);
    if (s != null)
      s.play();
  }
View Full Code Here

Examples of org.newdawn.slick.Sound

  public void playSound(String name, float x, float y, float z) {
    float w = screen.getWidth();
    float h = screen.getHeight();
    x = 2 * (x - w / 2) / w;
    y = 2 * (h / 2 - y) / h;
    Sound s = getSound(name);
    // System.out.println("play at " + x + "," + y);
    if (s != null)
      s.playAt(x, y, z);
  }
View Full Code Here

Examples of org.newdawn.slick.Sound

   */
  public static void main(String[] args) {

    // Wikipedia Beispielsound in einem neuen Thread abspielen
    try {
      new Sound(
          new URL(
              "http://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg"))
          .play();
    } catch (MalformedURLException e) {
      e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.