[英]Playing short sounds in separate thread
In my android game, there are 36 falling balls. 在我的Android游戏中,有36个落球。 When a ball touches the ground a sound is played.
当球触地时,会发出声音。 The sound is very small, only 0.3 sec.
声音很小,只有0.3秒。 I am using
soundpool
class to play it. 我正在使用
soundpool
类进行播放。 It may happen in the game that all 36 balls fall in quick succession. 在游戏中可能会发生所有36个球快速连续掉落的情况。 Playing the sound so many times may block the UI thread.
多次播放声音可能会阻塞UI线程。 Is it advisable to play sound on separate thread ?
建议在单独的线程上播放声音吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.