loadSoundFile method

Future<Sound> loadSoundFile(
  1. String filePath
)

Loads a sound file and creates a Sound from it.

Implementation

Future<Sound> loadSoundFile(String filePath) async {
  final file = File(filePath);
  final bytes = await file.readAsBytes();
  return loadSound(AudioData.detectFromBuffer(bytes.buffer.asFloat32List()));
}