phonegap media sound stop playing after 5 times

前端 未结 3 1012
甜味超标
甜味超标 2020-12-31 17:11

I need to play the \"correct\" sound if user answer the question correctly and \"wrong\" if incorrect. The sound is playing at first but after at the fifth time I answer cor

3条回答
  •  醉梦人生
    2020-12-31 17:57

    Android has a finite amount of resources in order to play sounds. You keep creating a new Media object each time you want to play a file. You need to release the sounds you are not using. If you need to play those sounds multiple times each then consider creating separate media objects to hold a reference to those sounds.

    Read up on media.release.

提交回复
热议问题