Future<Sound> loadDataUrl(String dataUrl, [ SoundLoadOptions soundLoadOptions ])

Loads a sound from a data url.

Please be aware that browsers do support different kinds of audio types. You can get a list of supported types here: Sound.supportedTypes

var sound = await Sound.loadDataUrl("data:audio/mpeg;base64,<data>");
sound.play();

Source

static Future<Sound> loadDataUrl(
    String dataUrl, [SoundLoadOptions soundLoadOptions]) {

  var options = soundLoadOptions ?? Sound.defaultLoadOptions;
  switch (options.engine ?? SoundMixer.engine) {
    case SoundEngine.WebAudioApi:
      return WebAudioApiSound.loadDataUrl(dataUrl, options);
    case SoundEngine.AudioElement:
      return AudioElementSound.loadDataUrl(dataUrl, options);
    default:
      return MockSound.loadDataUrl(dataUrl, options);
  }
}