loadSound method

Future<LoadedSound> loadSound(
  1. TypedData audioData, {
  2. @Deprecated("Should be used only in case something is not working.") bool doAddToFinalizer = true,
})

Copies data to the internal memory location and creates a LoadedSound from it.

Implementation

Future<LoadedSound> loadSound(
  TypedData audioData, {
  @Deprecated("Should be used only in case something is not working.")
  bool doAddToFinalizer = true,
}) async {
  final platformSound = await _engine.loadSound(audioData);
  final sound = LoadedSound._(platformSound);
  if (doAddToFinalizer) _soundsFinalizer.attach(sound, platformSound);
  return sound;
}