playAudio method

dynamic playAudio(
  1. String filePath
)

Implementation

playAudio(String filePath) async {
  if (assetsAudioPlayer.isPlaying.value) {
    assetsAudioPlayer.stop();
  }
  assetsAudioPlayer.open(
    Audio(filePath),
    playInBackground: PlayInBackground.enabled,
    respectSilentMode: true,
    volume: 1,
  );
}