In my App I added two sounds, the first is played when the gamescreen start the second when the game is going to game Over screen.

Everything works fine but after about 12-13 games the second sound isn't played and until the player close completly the app and open it again every sound isn't played. How to solve?

Errors :

05-24 09:04:29.773    5571-5585/ E/AudioTrack﹕ AudioFlinger could not create track, status: -12
05-24 09:04:29.773    5571-5585/ E/SoundPool﹕ Error creating AudioTrack
05-24 09:04:32.421    5571-5585/ E/MediaPlayer﹕ error (-19, 0)
05-24 09:04:32.421    5571-5571/ E/MediaPlayer﹕ Error (-19,0)
  • \$\begingroup\$ Where was that error shown? Was any other information attached to it? \$\endgroup\$ – Anko May 24 '15 at 13:16
  • \$\begingroup\$ @Anko I added the errors, I also set in setOnCompletationListener music.dispose() but it still not working \$\endgroup\$ – user65825 May 24 '15 at 13:22
  • \$\begingroup\$ You probably should not be creating a new music object every time you need it. Create it once and then store it somewhere. But if it's a very large file and you would rather not store it then make sure to dispose it once you're done with it. \$\endgroup\$ – StrongJoshua May 24 '15 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.