Package com.drakulo.games.ais.core.audio

Source Code of com.drakulo.games.ais.core.audio.SoundHelper

package com.drakulo.games.ais.core.audio;

import org.newdawn.slick.SlickException;
import org.newdawn.slick.Sound;

public class SoundHelper {
  private static final String BASE = "data/audio/sounds/";
  private static final String EXT = ".wav";

  public static final String BUTTON_CLICK = BASE + "button_click";

  public static final String RESEARCH_COMPLETE = BASE + "research_complete";

  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();
    }
  }
}
TOP

Related Classes of com.drakulo.games.ais.core.audio.SoundHelper

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.