Mediaplayer SoundProblems

  • Replies:5
androidKani
  • Forum posts: 3

Feb 2, 2015, 10:43:41 AM via Website

Hi,

i am developing a little app with 13 ImagViews. Every Image has his own sound. The goal is that the app plays a sound and then you must push the right imageView. Everythink works fine but sometimes there is no sounds. So you push one or two pictures and then there isn´t a sound. Also in the other activitys there is no sound when this is happens.

To realize the app i have declarate 13 Mediaplayers and initialize every player with a sound. Is it posible that this is to much and sometimes the mediaplayer is crash?

Should i use a soundPool?

best regards

Reply
Robert Nesta Marley
  • Forum posts: 39

Feb 2, 2015, 1:02:57 PM via Website

i guess you should, i think that is a great idea

androidKani

Reply
androidKani
  • Forum posts: 3

Feb 2, 2015, 4:00:53 PM via Website

Now I use the soundPool and everythink is fine. One hint for everyone! Don´t use the Mediaplayer for many sounds, because it can crash the Mediaplayer and than you must restart your app. The best solution for many sounds is the SoundPool. It is easy to use and you have much more options to set.

Thanks :-D

Reply
Miran Kirn
  • Forum posts: 25

Feb 2, 2015, 10:15:03 PM via Website

Well,

More than one mediaplayer can cause problems.
In similar cases I use one mediaplayer and then do reset in init again for new sound.
Since now I have not seen any problems with that procedure.

Anyway, I think SoundPool is a good idea.

Regards,

Reply
Deactivated Account
  • Forum posts: 267

Feb 3, 2015, 2:43:19 AM via Website

It's always disturb more than 1 player at a time in the pc. So, my recommendation remove those who's you don't like and keep 1 you like. Then it will not disturb you again I think.

Reply
Samantha Hudson
  • Forum posts: 17

Feb 6, 2015, 12:51:53 PM via Website

I wish you best of luck in the development of your app.

Reply