Sound overlapping with multiple button presses

前端 未结 6 1537
野的像风
野的像风 2020-11-29 13:56

When I press a button, then press another one, the sounds overlap. How can I fix that so the first sound stops when another one is pressed?

 - (void)playOnce         


        
6条回答
  •  死守一世寂寞
    2020-11-29 14:32

    The code you've posted will only play one sound, the first sound sent to the method.

    If you want to only play one changeable sound, after stoping the player, release theAudio and then set the new sound.

提交回复
热议问题