5

I'm taking this Android Programming class, and I have to work on a project now. My applications should be able to add some effects like reverb/echo/chorus/etc. to an audio track.

I tried using PresetReverb and EnvironmentalReverb but with no success (the app runs but doesn't apply any effect).

So now I'm trying to find some libraries that I could integrate and use in my project or other solutions. Could anyone give me some advice? (I already googled it and couldn't find anything) Thanks in advance!

Later EDIT (here is some code I used to add reverb effect from the android audiofx library):

rv = new PresetReverb(1, 0);
rv.setPreset(PresetReverb.PRESET_LARGEROOM);
rv.setEnabled(true);
player.attachAuxEffect(rv.getId());
player.setAuxEffectSendLevel(1.0f); 

I checked out this solution too, but didn't work out for me. I tested my code on Genymotion Virtual Device Galaxy Nexus - 4.3 - API 18 and Samsung Galaxy Chat B5330.

Here is the github repo too: https://github.com/razvan-tudosa/android-mediaplayer

Community
  • 1
  • 1
Peter_Fretter
  • 1,135
  • 12
  • 20
  • 1
    I would suggest posting the code you used to try and get PresetReverb or other effects to work. Chances are we can help you figure out what you've done wrong... starting with simple guesses, make sure you have the MODIFY_AUDIO_SETTINGS permission and attach the effect after calling `setDataSource`. – Dave Jan 12 '14 at 15:10
  • 1
    If you want more elaborate effects, you'll have to use a more low level approach, where you work with buffers of audiosamples which you put through some calculations before sending them to : http://developer.android.com/reference/android/media/AudioTrack.html – Emile Vrijdags Jan 12 '14 at 23:36
  • 2
    I found the same problem - I can't get the AudioEffects to work on an AudioTrack at all. No errors, nothing in logcat, sound plays but no effects! Very frustrating. Tried multiple devices and OS versions. – Ben Clayton Nov 10 '15 at 09:56
  • @BenClayton same here, have you had any luck getting effects to work? – Mateus Gondim Dec 14 '16 at 14:11
  • @MateusGondim Nope - tried everything I could think of. Concluded that it simply doesn't work. – Ben Clayton Dec 14 '16 at 20:45
  • That was so long ago, but I remember giving up on it, since I couldn't make it work also. – Peter_Fretter Dec 15 '16 at 09:15

1 Answers1

-1

i don't understood you enough but if you want to add normal sounds MediaPlayer if you want sound effects that really short use soundpool check thenewboston for fast video tutorials about sounds and effects

alanazi
  • 82
  • 9
  • After I load a sound with MediaPlayer and play it, I want to put an effect like a reverb on top of it. Sorry for not being so clear. – Peter_Fretter Jan 11 '14 at 19:51
  • see this question in [here](http://stackoverflow.com/questions/13950338/how-to-make-an-android-device-vibrate) if you want vibration – alanazi Jan 11 '14 at 20:01
  • haha now i understand sorry i don't know about effects i'm dumb sorry :) – alanazi Jan 11 '14 at 20:06