play method
播放音效
assetPath 资源文件路径(如: 'sounds/win_sound.mp3')
示例:
await audioPool.play('sounds/click.mp3');
返回:Future
Implementation
Future<void> play(String assetPath) async {
final player = players[currentPlayerIndex];
currentPlayerIndex = (currentPlayerIndex + 1) % players.length;
await player.play(AssetSource(assetPath));
}