android soundpool heapsize overflow

前端 未结 3 1758
梦如初夏
梦如初夏 2020-12-01 22:16

I get this error hundreds of times when I run in Debug, it doesn\'t seem to affect the program, but how do I get rid of it?

I know it can be traced back to the Sound

3条回答
  •  爱一瞬间的悲伤
    2020-12-01 22:57

    Maybe your media resource is too big for playing with soundpool. Soundpool only plays short sound effects. On the Soundpool API there is no specification about the maximum of a resource for playing with soundpool, but if You use it, play just short sound effects like, for example, a short explosion in a shooter game. If this is Your problem, You should use MediaPlayer for playing your sounds.

提交回复
热议问题