• Android uses soundpool to play sound effects


    If intensive and short sound effects need to be played in application (such as sound effects of games), soundpool is used to play sound effects. Soundpool uses the concept of sound pool to manage multiple short sound effects. For example, it can start with 10 sound effects and then play them according to the sound […]

  • Android uses soundpool to play short sound effects


    preface For Android playing some short sound effects, such as prompt tone or ring tone, soundpool can save more resources than using mediaplayer, and can play multiple sound effects at the same time, and can set different playback quality for different sound effects realization The specific function of soundpool will not be explained any more, […]

  • Android soundpool for short small sound effects


    1、 Introduction to soundpool We used mediaplayer to play audio files before, but when our application needs to play intensive and short audio effects frequently, calling mediaplayer will take up a lot of resources of the system, and the delay time is long, so it does not support multiple audio playing at the same time. […]

  • Android uses SoundPool to play audio


    Recently, I did a small function of playing audio, using the blank interface to simply record it (click on the ImageButton above to play, and ignore the ImageView below). Activity_picture.xml page: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” tools:context=”.PictureActivity”> <ImageButton android:id=”@+id/ibCogVideo” android:layout_width=”100dp” android:layout_height=”100dp” android:src=”@mipmap/ic_launcher” /> <ImageView android:id=”@+id/ivCogPicture” android:layout_width=”300dp” android:layout_height=”300dp” android:layout_marginTop=”100dp” android:src=”@mipmap/ic_launcher” /> […]