Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. private void playSound() {
  2.  
  3. audioAttributes = new AudioAttributes.Builder()
  4. .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
  5. .setUsage(AudioAttributes.USAGE_MEDIA)
  6. .build();
  7. sp = new SoundPool.Builder().build();
  8. int soundId = sp.load(getApplicationContext(), R.raw.errorsound, 1);
  9. sp.play(soundId, 1, 1, 1, 1, 1f);
  10.  
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement