List of usage examples for com.google.gwt.dom.client AudioElement TYPE_WAV
String TYPE_WAV
To view the source code for com.google.gwt.dom.client AudioElement TYPE_WAV.
Click Source Link
From source file:com.google.gwt.sample.mobilewebapp.client.ui.SoundEffects.java
License:Apache License
/** * Prefetch the error sound./*from w w w . j a va2 s .co m*/ */ public void prefetchError() { if (isSupported && error == null) { error = Audio.createIfSupported(); error.addSource("audio/error.ogg", AudioElement.TYPE_OGG); error.addSource("audio/error.mp3", AudioElement.TYPE_MP3); error.addSource("audio/error.wav", AudioElement.TYPE_WAV); prefetchAudio(error); } }
From source file:net.cbtltd.client.field.MediaControl.java
/** * Sets the ID of an audio object.//from ww w. ja v a 2s . c om * * @param value the new ID of the audio object. */ public void setAudioValue(String value) { Log.debug("setAudioValue " + value); try { this.value = value; if (media == null || value == null || value.isEmpty()) { return; } else if (MediaElement.CAN_PLAY_PROBABLY.equals(media.canPlayType(AudioElement.TYPE_WAV))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_WAV); } else if (MediaElement.CAN_PLAY_PROBABLY.equals(media.canPlayType(AudioElement.TYPE_MP3))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_MP3); } else if (MediaElement.CAN_PLAY_PROBABLY.equals(media.canPlayType(AudioElement.TYPE_OGG))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_OGG); } else if (MediaElement.CAN_PLAY_MAYBE.equals(media.canPlayType(AudioElement.TYPE_WAV))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_WAV); } else if (MediaElement.CAN_PLAY_MAYBE.equals(media.canPlayType(AudioElement.TYPE_MP3))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_MP3); } else if (MediaElement.CAN_PLAY_MAYBE.equals(media.canPlayType(AudioElement.TYPE_OGG))) { media.setSrc(HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + Text.AUDIO_OGG); } else { return; } media.load(); //media.setPreload(MediaElement.PRELOAD_AUTO); Log.debug("loaded " + value); } catch (Exception x) { Log.error( "setAudioValue " + HOSTS.rootUrl() + HasUrls.AUDIO_DIRECTORY + value + "\n" + media.getError()); } }