Tuesday, August 31, 2010

HTML5 audio support added to gwt-voices-2.0.0.jar

GWT developers,

Want to add sound effects to your GWT apps?

The gwt-voices project has long provided a simple API for adding sound to your GWT apps, which can be useful for business applications and games alike.

To date, gwt-voices provided audio support via the browser's native capabilities (remember the BGSOUND tag and its friends?) and, if installed, Adobe Flash (for MP3 files).
This latest version of gwt-voices adds automatic support for HTML5 audio for modern browsers. Of course, the old native audio and Flash fallback functionality is still in place in case your users need it.

To get started, add the gwt-voices jar to your project's classpath and inherit the gwt-voices module:
    <inherits name="com.allen_sauer.gwt.voices.gwt-voices" />

Then simply play() your sound:
    SoundController sc = new SoundController();
    Sound sound = sc.createSound(Sound.MIME_TYPE_AUDIO_OGG_VORBIS,
        "mysoundfile.ogg"); // put the file in the 'war' directory

The main project site, which includes a live demo, is here:
  http://code.g oogle.com/p/gwt-voices/

Interested in seeing which MIME Types are supported by the various HTML5 capable browsers? Look no further than this crowd sourced data (your own user agent will be highlighted in yellow):

Full set of Release Notes:

A more complete Getting Started guide:

Feedback is always welcome.

Fred Sauer
Developer Advocate
1600 Amphitheatre Parkway
Mountain View, CA 94043

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment