runAudioPlayer method

Future<void> runAudioPlayer(
  1. String path
)

A reusable function to play the sound.

Implementation

Future<void> runAudioPlayer(String path) async {
  await player.setAsset(path);
  await player.play();
}