Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing a sound notification using Google Web Toolkit

Is it possible to play a sound notification using Google Web Toolkit which will be translated to Javascript? Thanks.

like image 258
Ali Avatar asked Feb 11 '09 21:02

Ali


2 Answers

Since GWT 2.2 you can play audio with: com.google.gwt.media.client.Audio class.

API: http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/media/client/Audio.html

Sample:

private Audio mistakeAudio;

{
    mistakeAudio = Audio.createIfSupported();
    mistakeAudio.setSrc("style/failure.wav");
}

public void mistakeSound(){
    mistakeAudio.play();
}
like image 174
Daniel De León Avatar answered Oct 17 '22 02:10

Daniel De León


Try using this library: http://code.google.com/p/gwt-voices/

like image 31
Isaac Waller Avatar answered Oct 17 '22 01:10

Isaac Waller