2

Is it possible to add specific reverb to my sound effect/music track in libgdx? I want to add outdoor/indoor reverb to make all tracks sounded the same.

2 Answers 2

4

I don't think that Libgdx has a mechanism to adding effects to sound. The Sound class delivers no function for this.

I see three solutions here:

  • Prepare two kinds of sounds (one with reverb one without - it is easy to do using software like Audacity - and play one or another due to environment of player's current being
  • Try to implement it yourself

    I see that in the Sound class there is setPitch(long soundId, float pitch) method. Due to Wikipedia the reverb is just a kind of echo so maybe (but not for sure) you could achieve the effect by

    1. making copy of sound
    2. slowering it a little
    3. lowering the volume
    4. playing simultaneously with original sound

     

  • Find 3rd part library that will do it for you - the Google returns some examples of libs working with libgdx like SoundTouch Audio Processing Library - maybe you will find something usefull

First one is the easiest and if you are not afraid of space problems I would strongly recommend it to you (althought why not to try implementing it)

1
0

I've implemented reverb, positional audio, and arbitrary filters using OpenAL against the latest libgdx 1.10+/lwjgl 3+ with this demo code, based off of gdx-sfx (which only works with lwjgl 2) and libgdx-audio-effects.

I'd like to promote this into a fully fledged library at some point 😂

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.