getMusicDurationInMS method

int getMusicDurationInMS(
  1. String path
)
override

Getting the Total Length (ms) of Background Music

This API is used to retrieve the total length of a background music file.

  • Parameters:
    • path(String):
      • Path of the music file.

Return Description: The length of the specified music file is returned in milliseconds. -1 indicates failure to get the length.

Implementation

int getMusicDurationInMS(String path) {
  ffi.Pointer<ffi.Char> pathPointer = path.toNativeUtf8().cast<ffi.Char>();
  int result = _audioEffectFFIBindings.get_music_duration_in_ms(_nativePointer, pathPointer);
  calloc.free(pathPointer);
  return result;
}