Play/pause button for mediaplayer and soundpool

Sometimes the user is playing your game in an office or in a classroom, he may like to switch off the game sounds. And sometimes he may like to switch off sounds to save battery. So it is important to have to a play/pause button for the sounds in your app. To use a mediaplayer for background sound in Sketchware , in onCreate event use MediaPlayer create, set looping and start blocks. For using soundpool, add a number variable 'sound' . Then use soundpool create max stream count (5) (*if you have five different sounds). Then one by one add the five sounds to the number variable 'sound' using the block soundID...load... And then wherever the sound is to be played, set number variable 'sound' to StreamID SoundPool name play sound ID ... 1+ times . Now, in order to create a play/pause button for both the Mediaplayer and the soundpool together, follow the steps given below. 1. Add an Imageview and two images, one for sound on and other for sound o...