DjSound extension
This extension is based on the Soundpool class and overcomes the Sound component limit of only 10 simultan audio streams. With only 1 instance you can load a list of soundfiles into memory and play them by their id.
I made this extension for use in music apps like a Piano where you want to load a bank of Sounds at once. I can load 24 sounds without problems.
Note: Soundfiles should be under 1 mb size as the limt of the Soundpool class.
Better use mono sounds. Use ogg files for good results.
soundList: List of soundfiles
soundId: int
leftVol / rightVol: 0-100
speed: 100 = normal speed
version 1: com.django.djSound.aix (8,1 KB)
Demo aia for a piano app based on a canvas my other thread.
Update v2
- added loop function
- pause and resume all active soundStreams

- stop all active soundStreams.

- returns a list of all active soundStreamIds.

- get the Id of the last active soundStream.
- pause soundStream by Id
- resume soundStream by Id
- I think you got it
- Example how to set the speed to 150% on a selected soundStream
- Example how to archieve the same as the StopAll method.
With a simple loop you can edit the other methods as well for all active soundStreams at once.
version 2:
com.django.djSound.aix (11,3 KB)
I will Update the aia in my other thread these days.








