Examples of Sound


Examples of org.newdawn.slick.Sound

                getImage(
                    identifier.substring(0,
                        identifier.indexOf('?')))
                    .getFlippedCopy(true, false));
      } else if (identifier.endsWith(".ogg")) { // Sound laden
        this.sounds.put(identifier, new Sound(identifier));
      } else { // Ressourcentyp unbekannt
        throw new ResourceError("Unkown ressource type: " + identifier);
      }
    } catch (SlickException e) {
      throw new ResourceError(e);
View Full Code Here

Examples of org.newdawn.slick.Sound

   * @return Die Sounddatei.
   */
  public Sound getSound(String id) {
    id = normalizeIdentifier(id);

    Sound sound = this.sounds.get(id);
    if (sound == null) {
      load(id);
      return this.sounds.get(id);
    } else {
      return sound;
View Full Code Here

Examples of org.newdawn.slick.Sound

    }

    private void loadSound() {
        try {
            for (int i = 0; i < ambiente.length; i++) {
                ambiente[i] = new Sound("audio/" + i + ".ogg");
            }
            remate[0] = new Sound("audio/remate1.ogg");
            remate[1] = new Sound("audio/remate2.ogg");
            poste[0] = new Sound("audio/poste1.ogg");
            poste[1] = new Sound("audio/poste2.ogg");
            ovacion[0] = new Sound("audio/ovacion1.ogg");
            ovacion[1] = new Sound("audio/ovacion2.ogg");
            gol = new Sound("audio/gol.ogg");
            rebote = new Sound("audio/rebote.ogg");
            silbato = new Sound("audio/silbato.ogg");
        } catch (Exception ex) {
            ex.printStackTrace();
            //nosound
        }
    }
View Full Code Here

Examples of org.newdawn.slick.Sound

        paImage = new Image("imagenes/pausa.png");
        reImage = new Image("imagenes/retrocede.png");
        if (sonidos) {
            try {
                for (int i = 0; i < ambiente.length; i++) {
                    ambiente[i] = new Sound("audio/" + i + ".ogg");
                }
                remate[0] = new Sound("audio/remate1.ogg");
                remate[1] = new Sound("audio/remate2.ogg");
                poste[0] = new Sound("audio/poste1.ogg");
                poste[1] = new Sound("audio/poste2.ogg");
                ovacion[0] = new Sound("audio/ovacion1.ogg");
                ovacion[1] = new Sound("audio/ovacion2.ogg");
                gol = new Sound("audio/gol.ogg");
                rebote = new Sound("audio/rebote.ogg");
                silbato = new Sound("audio/silbato.ogg");
            } catch (Exception ex) {
                ex.printStackTrace();
                //nosound
            }
        }
View Full Code Here

Examples of org.newdawn.slick.Sound

  private void loadSound(Element element) throws SlickException {
    checkRequiredAttributes(element, "key", "file");
    String key = element.getAttribute("key");
    String file = element.getAttribute("file");
    Log.debug(formatLoadMsg("sound", key, file));
    ResourceManager.addSound(key, new Sound(baseDir + file));
  }
View Full Code Here

Examples of org.newdawn.slick.Sound

    public static Music getMusic(String name) throws SlickException {
        return new Music(getResourceFolder() + "music" + FILE_SEPARATOR + name + ".ogg");
    }

    public static Sound getSound(String name) throws SlickException {
        return new Sound(getResourceFolder() + "sounds" + FILE_SEPARATOR + name + ".wav");
    }
View Full Code Here

Examples of org.newdawn.slick.Sound

    ) throws SlickException {
   
    this._stateBasedGame = game;
    this._container = container;
   
    Sound buttonSound = new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
   
    // buttons:
    this._buttonListener = new StickyListener();
   
    this.createExitButton(container, buttonSound);
View Full Code Here

Examples of org.newdawn.slick.Sound

    throws SlickException {
   
    this._stateBasedGame = game;
    this._container = container;
   
    Sound buttonSound = new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
   
    // buttons:
    this._buttonListener = new StickyListener();
   
    this.createLevelButtons(container, buttonSound);
View Full Code Here

Examples of org.newdawn.slick.Sound

    // create the buttons if not yet initiated:
    // set up the buttons:
    this._buttonListener = new StickyListener();
   
    this._buttonSound =
      new Sound(VisualBurglar.PATH_SOUNDS + SUBPATH_CLICK_SOUND);
    // buttons:
     
    this._buttonPanel.init(container, this._buttonListener, this._buttonSound);
   
    this._contextMenu.init(container, this._buttonListener, this._buttonSound);
View Full Code Here

Examples of org.newdawn.slick.Sound

  public static final String BUILDING_START = BASE + "building_start";
  public static final String BUILDING_END = BASE + "building_end";
 
  public static void playSound(String key) {
    Sound s;
    try {
      s = new Sound(key + EXT);
      s.play();
    } catch (SlickException e) {
      System.out.println("Could not play sound : " + key + EXT);
      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.