How to use soundpool in Sketchware?

The soundpool component is used to play sounds of smaller duration in android apps and a single soundpool component can be used to play multiple sounds.

Now suppose you have three sounds which you want to use in a game at different instances. To use the sounds follow the steps given below.

1. Open the Sketchware project in which you want to use the sounds. Go to sound manager and add the three sounds which you want to use.

2. Now add a soundpool component (named 'sounds' in the image below) in the Logic section of your app.

3. After this go to onCreate event and add a number variable (named sound in the image below).

4. Then in onCreate event, first use the block: SoundPool (name) create max stream count.... Since here three sounds are being used set max stream count to 3.

After that use SoundID:SoundPool (name) load (sound name) and set the number variable to load the three sounds one by one, as shown in the image below.
This will set the SoundID of the three sounds to 1, 2 and 3, depending on the sequence in which they are loaded to the number variable.

5. Now at any time in your app whenever you want to play the sound use the following block:
Set (variable name) to StreamID: SoundPool (name) play sound ID (ID of sound; 1, 2 or 3) 1+ (write 1 less than number of times sound is to be played) times

The Sound ID is set to the sequence in which the sounds were loaded to the variable. So, if you want to play the second sound write sound ID as 2.

1+ __ times determines the number of times the sound will repeat. If it is left blank, the sound will play only once.

The images below shows how to use it.

Watch the video below for better understanding:


  1. Sound logic is added from the first to third page, but the fourth or upper page sound logic is added, but after the save out, they are deleted and not received. Please help someone.

  2. should you set this all up on the mainactivity page regardless of which activity page uses the sounds?

    1. It should be set in the Activity on which sound is to be played.

    2. Thank you, both for your response and for this great blog. I would have quit using Sketchware by now if wasn't for this extremely helpful blog.

  3. I noticed that if I play the same sound with soundpool, it doesn't have as as much loudness as if I play it with mediaplayer. Does anyone have idea why is that and what could I do do against it?

  4. This comment has been removed by the author.

  5. This comment has been removed by the author.

  6. Hi! Not working. When I execute I have "Raw cannot be resolved or it's not a field"
    Want help

  7. When I add a son to my project it disappears. If time its 2mn i have 0mn. Why? Thanks.

  8. I can't add Soundfiles to the spundmanager at all. I have tried many different formats, but the file is just not showing up, any idea why?

    1. Because you aren't allowed to do that by other of Google

    2. Help me I am not able to add sound in manager
      How I can allow this please help


    Will you please check the above app? I have used 30 sounds in the alphabet screen in 6 rows with six different sound pool components. In every rows 5 text views inserted pressing which the play button is assigned with a new sound file. So there are 6 play button in the page. The problem is that some time the it stops playing any sound. The app is created in Sketchware. Hope you can help. You can contact me at

  10. Constructor SoundPool is depreciated. What now?

  11. Can you help me about the soundpool, i want it to be like you click a button where you can choose it as a ringtone

  12. my sound is really short so sketchware crashes when i try to import it pls help


Post a Comment

Popular posts from this blog

Create Music Player app in Sketchware

A Flash Light App in Sketchware

Admob rewarded video Ads in Sketchware

Simple car racing android game in Sketchware

Firebase auth in Sketchware for Login Activity