play method

Future<void> play()

Starts the playback

Throws an Exception if the player is not initialized

Throws an Exception if the playback is not started

Implementation

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

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

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

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