SoundPool – Android Studio Tutorial
In this video we will learn, how to use the SoundPool class to play short, repetitive sound clips. Since API level 21 (Android Lollipop), the old SoundPool constructor is deprecated, so we will also learn, how to use the new SoundPool.Builder class. We will define a streamType for the old constructor and a usage and contentType for the new Builder. We will also set the number of maxStreams so we can play multiple sounds simultaneously and we will learn, how to pause and resume sound files by saving their streamID in a variable.
Check out the MediaPlayer video:
Source code:
https://gist.github.com/codinginflow/9fc90f0ec0d99aa6a995eb4751f87090
Free sound clips:
freesound.org
____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io
⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching
❗ Subscribe to the channel:
https://www.youtube.com/c/codinginflo…
📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter
❓ Join our free developer community:
https://discord.gg/TSnMvmc
📣 Follow Coding in Flow on other sites:
Facebook: https://www.facebook.com/codinginflow
Instagram: https://www.instagram.com/codinginflow
TikTok: https://www.tiktok.com/@codinginflow
Twitter: https://twitter.com/codinginflow
Github: https://github.com/codinginflow
💰 Business requests, sponsoring, etc.: info@codinginflow.com
Views :57255
android studio