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

Please provide controls (gain, mute, balance, pan) for direct 24 bit audio

    Details

      Description

      A DESCRIPTION OF THE REQUEST :
      When using com.sun.media.sound.DirectAudioDevice as Mixer, you can easily playback audio with more than 16 bit/sample (if your hardware supports it).

      But you cannot use any controls on it, i.e. even mute and gain are disabled. Balance and pan as well.

      JUSTIFICATION :
      Greater than 16 bit/sample audio is becoming commonplace.

      At the same time, playing back audio without being able to control it volume/gain or even mute it, is of very limited value.
      Balance and pan would be nice to have, too.

      I'm not familiar with how the underlying native code interacts with the hardware, but the limitation to offering controls only for 16 bit and less seems arbitrary and needlessly limiting.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Offer at least the basic controls gain, mute, balance and pan for audio with more than 16 bits/sample, but most importantly 24 bits/sample.
      ACTUAL -
      The desired controls are not supported.

      ---------- BEGIN SOURCE ----------
      The restriction is hardcoded into:

      com.sun.media.sound.DirectAudioDevice$DirectDL#implOpen(...)
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      One might be able to re-sample to 16 bit audio, but the whole point of using 24 bit audio is exactly not to do this.

      So in the end one can only scale the decoded audio manually before sending it to the SourceDataLine, but that IMHO is actually a task better left to the Mixer.

        Attachments

          Activity

            People

            • Assignee:
              serb Sergey Bylokhov
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: