pause method

Future<void> pause()

Pauses the playback

Throws an Exception if the player is not initialized

Throws an Exception if the playback is not paused

Pauses the playback will not drop the queued buffers

Implementation

Future<void> pause() async {
  print('RS:---> pause');

  await _lock.synchronized(() async {
    _ensureInited();

    var state = await RawSoundPlayerPlatform.instance.pause(
      this,
    );
    _playState = PlayState.values[state];
    if (_playState != PlayState.paused) {
      throw Exception('Player is not paused');
    }
  });

  print('RS:<--- pause');
}