Android Example MultiTrigger Soundpool Example

As a response to a forum question a few months ago, I posted an example of using the Gesture Library and Soundpool to create a musical instrument interface. The example is simple an has only two sound samples, but is easily extended.

I am reposting as the latest version of JavaObject with B4a V3.8 allows setting Interfaces. Soundpool has an OnLoadCompleteListener, which can now be accessed. This is included in the example. If you are loading a lot of samples, this can take quite a while and the instrument won't function correctly until all samples are loaded. We can now block the use of the instrument until all sounds have been loaded, making a more user friendly app.

The sample just Logs when loading is complete, as it only loads two sounds, but you can use the listener to remove a splash panel, or message, or make buttons active or whatever you want.

I hope it's useful.

Requires: Gestures Library, JavaObject, Audio Library B4a 3.8+
 

Attachments

  • MultiTriggerSoundTouchExample.zip
    28.2 KB · Views: 1,396
Last edited:
Top