@@ -0,0 +1,2010 @@
+package com.shc.gwtal.client.openal;%0A%0Aimport com.google.gwt.dom.client.AudioElement;%0Aimport com.google.gwt.dom.client.Document;%0Aimport com.google.gwt.dom.client.MediaElement;%0Aimport com.google.gwt.typedarrays.shared.ArrayBuffer;%0A%0A/**%0A * %3Cp%3EA class useful for decoding the audio data from different file formats supported by the browser. Most common%0A * supported formats are WAV, OGG, WebM, but to check the support at runtime, you can use the following method.%3C/p%3E%0A *%0A * %3Cpre%3E%0A *     if (AudioDecoder.isSupported(AudioDecoder.FileFormat.MP3))%0A *         // MP3 is supported by the browser%0A * %3C/pre%3E%0A *%0A * %3Cp%3EThe work done by this class is done asynchronously. Note that there must be an active OpenAL context for this%0A * class to work. Otherwise it will crash with possibly a %7B@link IllegalStateException%7D.%3C/p%3E%0A *%0A * @author Sri Harsha Chilakapati%0A */%0Apublic final class AudioDecoder%0A%7B%0A    private static AudioElement tempAudioElement;%0A%0A    private AudioDecoder()%0A    %7B%0A    %7D%0A%0A    public static boolean isSupported(FileFormat format)%0A    %7B%0A        if (tempAudioElement == null)%0A            tempAudioElement = Document.get().createAudioElement();%0A%0A        switch (format)%0A        %7B%0A            case MP3:%0A                return !tempAudioElement.canPlayType(AudioElement.TYPE_MP3).equals(MediaElement.CANNOT_PLAY);%0A%0A            case WAV:%0A                return !tempAudioElement.canPlayType(AudioElement.TYPE_WAV).equals(MediaElement.CANNOT_PLAY);%0A%0A            case OGG:%0A                return !tempAudioElement.canPlayType(AudioElement.TYPE_OGG).equals(MediaElement.CANNOT_PLAY);%0A%0A            case WEBM:%0A                return !tempAudioElement.canPlayType(%22audio/webm%22).equals(MediaElement.CANNOT_PLAY);%0A        %7D%0A%0A        return false;%0A    %7D%0A%0A    public enum FileFormat%0A    %7B%0A        MP3, WAV, OGG, WEBM%0A    %7D%0A%0A    public interface OnDecoded%0A    %7B%0A        void invoke(ArrayBuffer arrayBuffer, int alFormat, int frequency);%0A    %7D%0A%0A    public interface OnError%0A    %7B%0A        void invoke(String reason);%0A    %7D%0A%7D%0A

Add AudioDecoder class to check support for formats