/** * Asynchronously loads and returns a music resource. On some platforms, the backend will use a * different implementation from {@link #getSound} which is better suited to the much larger size * of music audio data. * * <p> Note: if a request to play the sound is made before the sound is loaded, it will be noted * and the sound will be played when loading has completed. * * @param path the path to the sound resource. NOTE: this should not include a file extension, * PlayN will automatically add {@code .mp3}, (or {@code .caf} on iOS). */ public Sound getMusic (String path) { return getSound(path); }
/** * Asynchronously loads and returns a music resource. On some platforms, the backend will use a * different implementation from {@link #getSound} which is better suited to the much larger size * of music audio data. * * <p> Note: if a request to play the sound is made before the sound is loaded, it will be noted * and the sound will be played when loading has completed. * * @param path the path to the sound resource. NOTE: this should not include a file extension, * PlayN will automatically add {@code .mp3}, (or {@code .caf} on iOS). */ public Sound getMusic (String path) { return getSound(path); }
@Override public Sound getSound(String path) { Object object = null; if ((object = cache.get(path)) == null) { object = delegate.getSound(path); cache.put(path, object); } return (Sound) object; }
@Override protected Sound loadSound (String path) { return plat.assets().getSound(path); } }
protected Sound loadSound(String path) { Sound sound = game.assets.getSound(path); sound.state.onFailure(logFailure("Sound loading error: " + path)); return sound; }
protected Sound loadSound(final String path) { Sound sound = assets().getSound(path); sound.addCallback(new Callback<Sound>() { public void onSuccess(Sound sound) {} // noop public void onFailure(Throwable cause) { log().warn("Sound loading error: " + path, cause); } }); return sound; }
@Override public final Sound getSound(String path) { incrementRequestCount(); Sound sound = delegate.getSound(path); sound.addCallback(callback); return sound; }