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

Interface SourceDataLine dose not output sound correctly in j2re 1.5.0beta1.

XMLWordPrintable

    • b58
    • x86
    • windows_xp



      Name: gm110360 Date: 05/26/2004


      FULL PRODUCT VERSION :
      1.5.0beta-b32c(1.5.0beta1)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP1

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Audio device is SigmaTel C-Major Audio.

      A DESCRIPTION OF THE PROBLEM :
      In case of j2re 1.5.0beta1, audio applet, which can work correctly on j2re 1.4.2_04, did not work correctly. Please refer the following informations.
      -sample rate 32000bit/sec, sampleSizeInBits is 16bit, mono, signed, little endian sourceDataLine use.
      - It seems distorted audio which could not catch the communication.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.make sourceDataLine.
      2. write audio data.
      3. I hear it but output audio is distored.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1.OK
      2.OK
      3.I expected audio output correctly in j2re 1.5.0.
      ACTUAL -
      1.OK
      2.OK
      3.Audio output Distorted

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      nothing.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      create routine:

      private static final int SAMPLE_RATE = 32000;

      private static final int CHANNEL = 1;

      private static final int BITS = 16;


      format = new AudioFormat(SAMPLE_RATE, BITS, CHANNEL, true, false);

      DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
      System.err.println(info.toString());
      if(!AudioSystem.isLineSupported(info)){
      System.out.println("Line type is not supported: "+info);
      return;
      }
      try{
      sourceLine = (SourceDataLine)AudioSystem.getLine(info);
      sourceLine.open();
      } catch(LineUnavailableException e){
      System.out.println(e);
      sourceLine.close();
      return;
      }

      Output routine:
      sourceLine.write(b, off, available);
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      nothing.
      (Incident Review ID: 275118)
      ======================================================================

            fbomerssunw Florian Bomers (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: