APWidgets glitching

edited March 2016 in Android Mode

Hello all,

I'm trying to make an android application in which, if the user taps the screen, a sound is played (along with the other elements of the game). The sound plays for the first few times, but after a while it just stops, yet the application still works flawlessly. Also, in void setup(), I set it to play and loop a background song, but it rarely works. It seems that doing it via void draw() works, but it plays it too often (as it's meant to be). Is there a fix or an alternate sound library? Thanks!



  • edited May 2015

    It will be helpful if you showed how you're trying to do this, what Android version, what hardware, which Android audio API, etc

    I'm guessing (since APWidgets is in the title) that you're using APMediaPlayer. That's supposed to be the option for (say) looping a background soundtrack. I've only used this in very simple ways, but haven't had problems.

    For short UI sound effects, SoundPool is the way to go. I've used this a lot with no issues.

    You've probably seen this already: http://www.wiseandroid.com/post/2010/07/13/Intro-to-the-three-Android-Audio-APIs.aspx

Sign In or Register to comment.