Reverb and Gplayer Library

Gigatron

Member
Licensed User
Longtime User
Hi all

Here is my first two library for B4A.

API version 9.
These libs are working together, how to say,
One is for reverb effect on Music played with the other GPlayer.

Gplayer is exactly the same lib of B4A Mediaplayer, the difference is
contains 5 or 6 new methodes.

- ReverbLib Doc update
- Reverblib V1.40 added all set reverb functions


Lets begin

B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim time As Timer
    
   Dim rv As ReverbLib    ' Load Reverblib
    
   Dim gp As Gplayer     ' Load Gplayer
End Sub



B4X:
Sub Globals
   Dim EID As Int
   Dim id As Int
   Dim s As Float
   
End Sub



B4X:
Sub Activity_Create(FirstTime As Boolean)

     'Load mp3
    gp.Initialize2("gmp")   ' Init Gplayer
       id=0
      s=1.0      ' Float
      EID=0      'int  Id
    
    
   RV.Initialize
   If RV.IsAvailable AND RV.IsInitialized Then
     Log("OK")
      RV.Enable(True)
      RV.SetReverbLevel(2000)
      RV.SetReverbDelay(100)
      RV.SetDecayTime(10000)
      RV.SetRoomLevel(0)
      EID=RV.GetID
   End If
      
    gp.Load(File.DirAssets,"IonStage.mp3")   ' Load MP3
    gp.AttachEffect(EID)                           'Attach to EID Effect to Gplayer
    gp.SetEffectSendLevel(s)                     'Send Effect level to Gplayer
     gp.Play                                             ' Play MP3
   
End Sub


OK LET'S THANKS TO STEVEL05 for his great Help.

And Ofcourse Thanks To Master EREL for this powerfull devKIT B4A...

Please Test it ... dont forget i learn java, and B4A.... ;) 6% done///

Later
 

Attachments

  • testlib.zip
    5.9 KB · Views: 771
Last edited:

stevel05

Expert
Licensed User
Longtime User
Nice One. and extended the music player, good stuff.
 

Gigatron

Member
Licensed User
Longtime User
I can't get RV to initialize
I attached the project
View attachment 9258

Ok, i ve tested your project and it's working with no problems.

The only reason is:
Your run on api version <9.

On Emulator i have Gingerbread version.
Your device version must Android 2.3.3 , i have XperiaX10i under 2.3.3 and it's working.
Later
 

vb1992

Well-Known Member
Licensed User
Longtime User
I tried it in the bluestacks app player (emulator)
and it played the audio with re-verb, but only 2 seconds
of the 14 second mp3. I did get to hear the re-verb effect
but not sure why it stops after two seconds playing. After it
stops I can hit play again, and it will play it again for 2 more seconds
then stop...
 

Gigatron

Member
Licensed User
Longtime User
I tried it in the bluestacks app player (emulator)
and it played the audio with re-verb, but only 2 seconds
of the 14 second mp3. I did get to hear the re-verb effect
but not sure why it stops after two seconds playing. After it
stops I can hit play again, and it will play it again for 2 more seconds
then stop...

He i used google to translate your problem in French :)

The Environmental library use Gplayer , this library work together.
Audio effect is attached to Gplayer. It's not working with another MP3 Player.
This mean it's catch Effect ID and atache it TO Gplayer.

Hope you understand explanation with my poor english ....

Later
 

Gigatron

Member
Licensed User
Longtime User
Hi all

This time i have done PresetReverbLib, this library work exactly like
reverblib , you can choise PresetReverb to have ambiance during
listening audio file.

Suported reverb are:

PRESET_NONE = 0;
PRESET_SMALLROOM = 1;
PRESET_MEDIUMROOM = 2;
PRESET_LARGEROOM = 3;
PRESET_MEDIUMHALL = 4;
PRESET_LARGEHALL = 5;
PRESET_PLATE = 6;

ReverbPresetLib work with Gplayer library .

Here a little example:

B4X:
  'Load mp3
    gp.Initialize2("gmp")   ' init Gplayer
   
                    
      id=0                 'Preset effect ID
       pr.Initialize         'Preset Lib Init
     
     If pr.IsAvailable AND pr.IsInitialized Then   ' if available and initialized
       Log("OK")                                          'log  OK
       pr.Enable(True)                                   ' Enable presetlib
       id=pr.GetID                                        ' GET ID of PresetReverb
      pr.ReverbSetting(pr.PRESET_LARGEROOM) ' SET preset
     End If
      
      
        gp.Load(File.DirAssets,"2000AD1.mod.mp3")  'Load Amiga mod mp3 :)
        gp.AttachEffect(id)                                     ' Attache pr.GetID(id) to GPlayer
       pr.ReverbSetting(pr.PRESET_LARGEROOM)
       gp.SetEffectSendLevel(s)
      
        gp.Play                                                  'Play MP3

Use PresetReverbLib without ReverbLib .. i had a conflict error when i've tested together.
Use Presetreverblib with gplayer.
Or ReverbLib with gplayer.



Have Fun
 

Attachments

  • testlib.zip
    4.7 KB · Views: 337
  • Example.zip
    119.5 KB · Views: 327
Last edited:

vb1992

Well-Known Member
Licensed User
Longtime User
I did notice that changing the values of this

RV.SetReverbDelay()

doesn't do anything to the audio playback...

I tested this setting many times, no difference...
 

Gigatron

Member
Licensed User
Longtime User
Here is a start project
that you can use/test with

Thank you very much

I have added normaly all reverb functions ...Here is your modified test project.
The best way is test with headphone ...

Later
 

vb1992

Well-Known Member
Licensed User
Longtime User
I like that the Reverb Effect is real-time when making adjustments.
It's nice that you can change the effect. Great work. :icon_clap:

Is there a way to record the AudioFile with the reverb effect
once you have a good setting in place?

So you have a new AudioFile recording?
 
Top