[Free]DjSound extension

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.
block
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
2

  • added loop function
    3
  • pause and resume all active soundStreams
    5
  • stop all active soundStreams.
    8
  • returns a list of all active soundStreamIds.
    9
  • 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
    55
  • 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.

19 Likes

Nice extension :+1:

1 Like

Cool extension

1 Like

This will only work with Companion and on Android < 10. So that it also works on Android > 9, the paths must point to the ASD. It won’t work at all with the APK. To do this (like the extension is now) the sound files from the assets would first have to be copied into the ASD or into one of the Shared folders.

See also here:

4 Likes

Updated first post with version 2:
Added several functions. An updated aia will follow these days.

2 Likes