Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4226299

AudioClip does not play audio files as expected

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 2.0, 1.1.7
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      other, x86
    • OS:
      solaris_2.6, windows_nt

      Description



      Name: keC81026 Date: 04/02/99



              AudioClip doesn't play audio file as expected with jdk1.1.7.

      to reproduce
              1. compile SoundApplet.java
              2. execute "appletviewer example1.html"
              3. Note, that if sound.wav may be au-stereo, wav-mono, wav-stereo, you will get an error :
              ]=================================================
                      NativeAudioStream: invalid file type.
                      NativeAudioStream: invalid file type.
              ]=================================================



      ====================== SoundApplet.java =============================
      import java.awt.Graphics;
      import java.applet.*;
      import java.net.URL;
      import java.net.MalformedURLException;


      public class SoundApplet extends Applet {
          /** The URL of the sound to be played. */

          URL sound;
          AudioClip soundData = null;
          boolean isReady;

          public void getMedia() {
              try {
              sound = new URL(getDocumentBase(), "sound.wav");
              if (sound != null && soundData == null) {
                  soundData = getAudioClip(sound);
              }
              if (soundData == null) {
                  System.out.println("SoundArea: Unable to load data "+sound);
              }
              isReady = true;
              } catch (Exception e) {
              };

          }

          public void enter() {
              if (! isReady) {
                  showStatus("Loading media file...");
                  return;
              }
              long now = System.currentTimeMillis();
              soundData.play();

          }

          public void init( ) {
                      getMedia();
              enter();
          }
          public SoundApplet() {
              super();
          };

      }
      =========== example1.html =================================================


      <html>
        <body>
            <applet code=SoundApplet.class width=10 height=10>
            </applet>
        </body>
      </html>

      ===========================================================================
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kkytlesunw Kara Kytle (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: