pause method

Future<void> pause()

Pause playback

Implementation

Future<void> pause() async {
  try {
    if (_currentState == AudioState.playing) {
      await _audioPlayer.pause();
    }
  } catch (e) {
    print('Error pausing audio: $e');
    onError?.call('Failed to pause audio: $e');
  }
}