playVoice method

Future<void> playVoice(
  1. String path, [
  2. bool withDucking = true
])

Play a Voice Line (URL)

Triggers onDucking if withDucking is true, then plays the URL.

Params

  • path: remote audio URL (CDN, server, etc.)
  • withDucking: override for this call (default true)

Implementation

Future<void> playVoice(String path, [bool withDucking = true]) async {
  this.withDucking = withDucking;
  if (path.isEmpty) return;

  if (this.withDucking && onDucking != null) {
    await onDucking!();
  }
  await play(path);
}