getAudioLength method

Future<Duration> getAudioLength ()

Returns a Duration() with the current audio's length. Returns 0 if no audio is loaded

Implementation

static Future<Duration> getAudioLength() async {
  await _checkIfBound();
  dynamic audioLength = await _nativeChannel.invokeMethod("getAudioLength");
  return Duration(milliseconds: audioLength);
  // returns milliseconds
}