// Path: gnikrap-core/src/main/java/org/gnikrap/utils/MapBuilder.java
// public final class MapBuilder<K, V> {
//   private final Map<K, V> map;
// 
//   public MapBuilder(Map<K, V> map) {
//     this.map = map;
//   }
// 
//   public MapBuilder<K, V> put(K k, V v) {
//     map.put(k, v);
//     return this;
//   }
// 
//   public Map<K, V> build() {
//     return map;
//   }
// 
//   public static final <K, V> MapBuilder<K, V> buildHashMap(K k, V v) {
//     return new MapBuilder<K, V>(new HashMap<K, V>()).put(k, v);
//   }
// 
//   public static final <K, V> MapBuilder<K, V> buildTreeMapBuilder() {
//     return new MapBuilder<K, V>(new TreeMap<K, V>());
//   }
// }


import lejos.hardware.Audio;
import lejos.hardware.BrickFinder;
import lejos.hardware.Sounds;
import org.gnikrap.utils.MapBuilder;
import org.gnikrap.utils.ScriptApi;
  public int getVolume() {
    return audio.getVolume();
  }

  @ScriptApi
  public void beep() {
    audio.systemSound(Sounds.BEEP);
  }

  /**
   * Play with the volume defined with {{@link #setVolume(int)} .
   */
  @ScriptApi
  public void playTone(int frequency, int durationInMS) {
    audio.playTone(frequency, durationInMS, volume);
  }

  // public void playTone(int frequency, int durationInMS, int vol) {
  // audio.playTone(frequency, durationInMS, vol);
  // }

  // Currently not part of the ScriptAPI
  public void playFile(String filename) throws EV3ScriptException {
    playFile(filename, volume);
  }

  // Currently not part of the ScriptAPI
  public void playFile(String filename, int volume) throws EV3ScriptException {
    // TODO: implement
    // Sound.playSample(file, vol)
// Path: gnikrap-core/src/main/java/org/gnikrap/utils/MapBuilder.java
// public final class MapBuilder<K, V> {
//   private final Map<K, V> map;
// 
//   public MapBuilder(Map<K, V> map) {
//     this.map = map;
//   }
// 
//   public MapBuilder<K, V> put(K k, V v) {
//     map.put(k, v);
//     return this;
//   }
// 
//   public Map<K, V> build() {
//     return map;
//   }
// 
//   public static final <K, V> MapBuilder<K, V> buildHashMap(K k, V v) {
//     return new MapBuilder<K, V>(new HashMap<K, V>()).put(k, v);
//   }
// 
//   public static final <K, V> MapBuilder<K, V> buildTreeMapBuilder() {
//     return new MapBuilder<K, V>(new TreeMap<K, V>());
//   }
// }


// Path: gnikrap-core/src/main/java/org/gnikrap/script/ev3api/SimpleEV3Sound.java
import lejos.hardware.Audio;
import lejos.hardware.BrickFinder;
import lejos.hardware.Sounds;
import org.gnikrap.utils.MapBuilder;
import org.gnikrap.utils.ScriptApi;

  public int getVolume() {
    return audio.getVolume();
  }

  @ScriptApi
  public void beep() {
    audio.systemSound(Sounds.BEEP);
  }

  /**
   * Play with the volume defined with {{@link #setVolume(int)} .
   */
  @ScriptApi
  public void playTone(int frequency, int durationInMS) {
    audio.playTone(frequency, durationInMS, volume);
  }

  // public void playTone(int frequency, int durationInMS, int vol) {
  // audio.playTone(frequency, durationInMS, vol);
  // }

  // Currently not part of the ScriptAPI
  public void playFile(String filename) throws EV3ScriptException {
    playFile(filename, volume);
  }

  // Currently not part of the ScriptAPI
  public void playFile(String filename, int volume) throws EV3ScriptException {
    // TODO: implement
    // Sound.playSample(file, vol)
    throw new EV3ScriptException(EV3ScriptException.API_NOT_IMPLEMENTED, MapBuilder.buildHashMap("function", "playFile()").build());