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

.au sound file only played half-way (again!) 4105620

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs



      Name: rlT66838 Date: 04/06/2000


      java version "1.3.0rc2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc2-Y)
      Java HotSpot(TM) Client VM (build 1.3.0rc2-Y, mixed mode)

      Exactly the same as described in bug report 4105620:

      > Make an 8-bit, 8000 Hz, mono, mu-law sound file
      > named mysound.au, and then run the following
      > program. Only half the duration of the sound
      > is heard. The problem disappears if .wav format
      > is used or if a different sample rate is used
      > for the .au format.

      -------------------------------------------------------
      //----- try this code to play a 6-second sound file
      import sun.audio.*;
      import java.io.*;
      public class soundtest {
         public static void main(String argv[])
         {
            soundtest me = new soundtest();
            try {
               FileInputStream in = new FileInputStream("mysound.au");
               AudioStream as = new AudioStream(in);
                              System.out.println("Start audio");
               AudioPlayer.player.start(as);
               try { Thread.sleep(12000); }
               catch (Exception e) {}
                              System.out.println("Stop audio");
               AudioPlayer.player.stop(as);
            }
            catch(FileNotFoundException e){
               System.out.println("Couldn't find sound file");
            }
            catch(java.io.IOException e){
               System.out.println("Couldn't build audio stream");
            }
         }
      }
      (Review ID: 103376)
      ======================================================================

            kkytlesunw Kara Kytle (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: