releaseResources method

Future<void> releaseResources()

Releases all resources allocated for playing audio file.

Must be called even if the file was not played.

Throws VIException, if an error occurred.

Implementation

Future<void> releaseResources() async {
  try {
    await _methodChannel.invokeMethod(
        'AudioFile.releaseResources', <String, dynamic>{'fileId': _fileId});
    _eventSubscription.cancel();
    return Future.value();
  } on PlatformException catch (e) {
    throw VIException(e.code, e.message);
  } catch (e) {
    rethrow;
  }
}