Saturday, March 3, 2012

Music, Sounds, and Waiting

I'm hoping that it won't take many more back and forth posts on Scoreloop's support discussions before everything is set up. I feel like I'm close enough that the problem will be solved in one or two more replies. I kinda got my hopes up today, thinking that the final reply post that solves my leader board issues once and for all might be on the board when I woke up. Unfortunately, I forgot it is now the weekend and Scoreloop support team members probably don't spend their time replying to help messages on their days off. So, now I just have to wait a little longer. Here's hoping that I get the leader boards fully working on Monday or Tuesday.

I've got the music in my new game working just as well as the "music" in Color Coder. I ended up going with a background service so that I can keep the music going across all my activities (or different screens) without it restarting every time. As a result of using a service, the music is just being played with the Android MediaPlayer stuff, instead of something Android specific, but it seems to be working out well in my current play testing. When I was trying to understand services better, I saw a couple topics on programming support forums like stackoverflow.com where people asked for help with services and then people replied saying to avoid using them. The only thing is, nobody seems to explain why services should be avoided, and when I even attempted to look up why services might be bad or their pros and cons, I didn't find anything that described them negatively at all. As far as I can tell, most people just tend to steer clear because they can get complicated and a lot of people that use them don't understand their life-cycles or something. The background music that I've been doing with them isn't that complicated though, and I'm not attempting to do any complex data management or anything in a background service, so I think I'll be fine. If I come across an explanation to why services or bad, or somebody manages to convince me of a better way of doing things, I'll likely go back and reformat the code for my music playing, but for now it is working out quite well.

Oh, I also went back and switched the sound effects in Color Coder to being played with SoundPool instead of MediaPlayer. When I initially added the sound effects in I didn't really understand the difference between the two. I looked into it a bit more and it turns out that SoundPool is the better choice for short little clips (like the cell selection sound) while MediaPlayer is better for playing longer sound files, like music. So, I switched it all out and boom: my sound effects work better. Sometimes before they weren't playing in a way that felt very responsive. If you clicked cells too fast you would only hear 2 animations when you had clearly tapped 3 or 4 cells. Now (as far as I can tell) you get a sound for every tap, so I'm pretty happy with that. The sound only playing once or twice for 3 or 4 cell selections was one of my pet peeves in Color Coder.

No comments:

Post a Comment