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

AudioFormat does not handle uncommon bit sizes correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.2
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: fb126949 Date: 09/27/2002


      if you want to create e.g. a mono PCM AudioFormat with 18 bits sample size, the frame size should be 3 bytes. But the second constructor of AudioFormat creates an instance of AudioFormat with a 2 byte frame size.

      The following code demonstrates the problem:

      int bits = 18;
      AudioFormat format = new AudioFormat(44100.0f, bits, 1, true, false);
      if (format.getFrameSize() * 8 < bits) {
      System.out.println("bits = "+bits+" do not fit into a "+format.getFrameSize()+" bytes sample!");
      throw new Exception("Test failed");
      } else
      System.out.println("bits = "+bits+" fit OK into a "+format.getFrameSize()+" bytes sample!");
      System.out.println("Test passed");



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

        Attachments

          Activity

            People

            Assignee:
            fbomerssunw Florian Bomers (Inactive)
            Reporter:
            fbomerssunw Florian Bomers (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: