[Android] SoundPool

Android/Class 2015. 8. 7. 11:37 |

안드로이드 SoundPool 에 대해서 알아보겠습니다.

SoundPool은 간단한 알림음을 입힐 때 사용하면 좋습니다.

음악 재생 중, SoundPool을 재생 시키더라도 음악은 끊기지 않습니다.

mp3등 무거운 것들은 MediaPlayer을.....


SoundPool(int maxStream, int streamType, int secQuality)

1. 최대 스트림 갯수.

2. 스트림 타입

3. 샘플링 품질


soundPool.load(Context context, int resld, int priority)

1. 재생이 될 context

2. raw에 등록시킨 ID 값.

3. priority 우선 순위.


int play(int soundID, float leftVolum, float rightVolume, int priority, int loop, float rate)

1. SoundPool.load 가 리턴한 식별자

2. left 볼륨 값

3. right 볼륨 값

4. 우선순위

5. 반복횟수 0은 1회, -1은 무한반복, 1,2,3,4 는 추가 재생하는 횟수

6. 속도 비율 2는 2배 0.5는 절반 속도





'Android > Class' 카테고리의 다른 글

[RelativeLayout]  (0) 2015.10.21
[RecyclerView]  (0) 2015.09.18
[Renderer] Open GL View sample  (0) 2015.04.03
[PopupWindow] PopupWindow의 터치 처리  (0) 2015.03.10
[Exception] Exception의 종류  (0) 2014.08.28
Posted by 소망아기
: