Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Soundpool or media player?

Tags:

android

I am doing a cards game for android and I want that everytime a card is thrown, to play throwing sound. It is the same file. I will have also other sounds playing like background music , and certain clicks. What do you recommend to use, sound pool or create MediaPlayback and play it? What would be the advantage/disdvantage to each one? should I use ogg or mp3/wave file? Any help in this is appreciated. Thank you

like image 885
Snake Avatar asked May 17 '12 04:05

Snake


1 Answers

I would use the sound pool for short clips. I might be wrong but the sound pool has a smaller overhead plus it's the correct way to play short clips, it also allows you to specify how many times per second said sound clip can play which helps slower phones.

With regards to the mp3 vs ogg I use mp3. I don't believe there is any performance issues. Ogg is licence free but that doesn't really matter with regards to your app. Plus it might help if you plan on using these clips on another platform that doesn't play ogg files. No names mentioned :P

like image 196
James Avatar answered Sep 28 '22 08:09

James