Skip to content

custom extention from SoundPool with setOnCompletionListener without the low-efficiency drawback of MediaPlayer

Notifications You must be signed in to change notification settings

khliu1238/SoundPoolPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

SoundPoolPlayer

custom extention from Android SoundPool with setOnCompletionListener without the low-efficiency drawback of MediaPlayer.

creation:

SoundPoolPlayer mPlayer = SoundPoolPlayer.create(context, resId);
mPlayer.setOnCompletionListener(
	new MediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mp) { 	//mp will be null here
        	Log.d("debug", "completed");
        }
	};
);
mPlayer.play()

pause:

mPlayer.pause();

stop:

mPlayer.stop();

resume:

mPlayer.resume();

isPlaying:

mPlayer.isPlaying();

About

custom extention from SoundPool with setOnCompletionListener without the low-efficiency drawback of MediaPlayer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages