Little things can also add a lot of normally unnoticed polish to the apps we use and also the games we play on a daily basis. Thanks to animated graphics, sound clips, songs, and customized graphics, software has a tendency to feel a lot more responsive and interesting. However sometimes a bug comes along as well as breaks a part of that have. Today, we’re going to have a look at one of the most user-facing insects to go out with Android 4. 3: automatically looping sounds are generally broken in numerous apps.
The problem pops up when making a simple contact the actual play() way of the actual SoundPool class. One of the parameters passed in during the call will certainly set the selected sound to automatically repeat, possibly continuously and a specific variety of situations. The problem in Android 4. 3 is that the audio will only ever play as soon as, regardless how numerous repetitions are expected. This particular video demonstrates the proper behavior on the Nexus 7 with Android four. 2 . two, accompanied by the bug on the Nexus four with Android four. 3:
If you would like to do this for your self, I’ve composed another sample application to try on your own devices. Yes, that audio in the movie is of the windshield being broken. I’ve also uploaded the source code in order to Github.
This problem won’t affect all apps as well as games because designers have a couple of options for generating sound. Several music players are likely to depend on the actual MediaPlayer class as it handles the majority of the hard work for various types, large files, and streaming over a network. Most video game developers dealing with the actual NDK (Native Improvement Kit) are more likely to need very precise time and minimal over head, which means they will take OpenSL HA SIDO (the audio equal in order to OpenGL ES). However developers who simply need some background music and some sound clips may take benefit of SoundPool, which is both easy to use and usually light-weight. Optionally, the actual AudioTrack class provides a little more control at the cost of simpleness, and is actually what SoundPool uses concealed from the public view.
Do not too concerned regarding this bug, the Android team has already acknowledged the issue and published a fix. Theoretically, the problem was located in the underlying AudioTrack class, but conditions for hitting this were exposed due to the well-known usage of SoundPool. Because noted through the Android group, developers may want to think about creating workarounds for devices running four. 3, which probably means programming manual looping routines that belongs to them. Fortunately, of the relatively little pool of devices running Android four. 3 this particular early, them all should progress to four. 3. 1 soon after it rolls out, ultimately eradicating the issue.
For now, become a bit flexible of apps and do not be too surprised if things like background seems go mysteriously quiet. Like the majority of transient insects of this nature, they will be unsuccsefflull and easily overlooked. Try to give designers a little bit of time to find remedies, and hope for Google’s technicians to launch an update quickly. At the same time, take another opportunity to take pleasure in a few of the modern features Android 4. 3 has to offer.
[AOSP Issue Tracker #58113, Bug Fix]