createSynth method

  1. @override
Future<String> createSynth(
  1. SynthKitSynthOptions options
)
override

Implementation

@override
Future<String> createSynth(SynthKitSynthOptions options) async {
  final ffiPlatform = _resolvePlatformOrThrow();
  if (ffiPlatform != null) {
    return ffiPlatform.createSynth(options);
  }
  final synthId = await methodChannel.invokeMethod<String>(
    'createSynth',
    options.toMap(),
  );
  if (synthId == null || synthId.isEmpty) {
    throw PlatformException(
      code: 'synthkit/no_synth_id',
      message: 'Native backend did not return a synth id.',
    );
  }
  return synthId;
}