Menu

equalizer

Help
Anonymous
2001-08-23
2004-06-21
  • Anonymous

    Anonymous - 2001-08-23

    could it be that the equalizer isn't working correctly? calling the Equalizer(float[] settings) method from outside doesn't seem to change anything in the sound...

     
    • Kevin Boone

      Kevin Boone - 2004-06-11

      Hi

      I can't get the equalizer to work either. I've had a look in the code, and it does appears that the values passed into the decoder through the setEqualizer method do find there way down into the guts of the decoder logic; but, once their, they don't seem to have any effect. I'm not very familiar with the mathematics of MP3 decoding, so I couldn't figure out if one could expect the equalizer to work.

      Other than this, javalayer works very nicely for me. It would be nice if one of the developers could indicate whether this problem is a bug and, if so, if there are any plans to sort it out in a later version.

      Best wishs
      Kevin

       
      • JavaZOOM

        JavaZOOM - 2004-06-11

        See BasicPlayer API and jlGui. They both use Equalizer successfully.
        http://www.javazoom.net/jlgui/developerguide.html

         
        • Kevin Boone

          Kevin Boone - 2004-06-11

          Hi

          Thanks for replying. I appreciate that I'm not arguing from authority here, because I haven't actually run jlGui (because I haven't yet had the opportunity to download all the bits it needs). Nevertheless, if anyone can explain how it interacts with the equalizer class in javalayer I'd be very grateful.

          I had a look at the source of the class javazoom.jlgui.player.amp.ui.Equalizer, which I sort of assume provides the user interface. It appears that when the user does something on the UI this results in a call to synchronizeEqualizer(), which does some arithmetic and calls updateBands(), which does some more arithmetic and initializes and array called bands. However, bands is a private instance variable and, so far as I can see, no method is provided to get to it from outside the Equalizer class. So I can't see how this class can have any effect. Sorry if I'm being thick.

          Looking at the API document, it appeared to me that what was necessary was something like this:

          decoder = new Decoder();
          equalizer = new Equalizer();
          equalizer.setBand(0, -0.5); // or whatever
          decoder.setEqualizer(equalizer);

          However this doesn't work for me. I was wondering if the order of events is significant; e.g., perhaps it matters whether the code calls decoder.setEqualizer() before the AudioDevice is opened, or after.

          If anyone can shed any light on this -- either how jlGui gets its equalizer values out to javalayer, or how the javalayer API is supposed to be used, I'd be enormously grateful.

          Best wishes
          Kevin

          PS. I'm using JavaLayer 0.4, which I think is the latest version, but I could be wrong.

           
          • JavaZOOM

            JavaZOOM - 2004-06-11

            Oh, OK. The code you need (with JavaLayer usage) is under MP3 SPI.
            http://www.javazoom.net/mp3spi/sources.html

            See : DecodedMpegAudioInputStream.java

             
            • Kevin Boone

              Kevin Boone - 2004-06-12

              Hi

              Thanks for your prompt help so far. Sadly, I am still unable to get it to work, and I'd be grateful for your further assistance, if possible.

              I've looked at DecoderMpegAudioInput.java as you suggest and, indeed, it is doing things somewhat differently to me. However, I can't figure out which of the differences are crucial to getting the equalizer to work, and which are not. I notice, for example, that in this class (lines 180-184) you initialize the equalizer bands from an array, and then call decoder.setEqualizer() on _every_ decoded frame. It isn't clear to me why this would be necessary, but it's no problem if it is. In addition, I notice that when you create the decoder, you call setOutputBuffer(); then in line 185 you do

              Obuffer decoderOutput = decoder.decodeFrame(...)

              but don't use the output for the decodeFrame() method call. I assume that this is some hang-over from earlier code. However, in my code I collect the output from decoder.decodeFrame() as in line 185, and pass it to AudioDevice to output. Does it make a difference to the way that the equalizer works how the output from the decoder is collected?

              Best wishes
              Kevin

               
              • JavaZOOM

                JavaZOOM - 2004-06-21

                Could we continue this thread on our (official) online MP3&Java forum ?
                http://www.javazoom.net/services/forums/index.jsp

                Thanks.

                 

Log in to post a comment.