dart_synthizer 0.11.3 copy "dart_synthizer: ^0.11.3" to clipboard
dart_synthizer: ^0.11.3 copied to clipboard

Dart bindings for the Synthizer sound library.

example/dart_synthizer_example.dart

// ignore_for_file: avoid_print
import 'dart:io';

import 'package:dart_synthizer/dart_synthizer.dart';

/// The basics of Synthizer.
Future<void> main() async {
  final synthizer = Synthizer()..initialize();
  print('Using Synthizer v${synthizer.version}.');
  final ctx = synthizer.createContext();
  print('Created context.');
  final source = ctx.createDirectSource();
  print('Created source.');
  final generator = ctx.createBufferGenerator(
    buffer: Buffer.fromFile(synthizer, File('sound.wav')),
  )..looping.value = true;
  source.addGenerator(generator);
  await Future<void>.delayed(const Duration(seconds: 2));
  generator.destroy();
  print('Generator destroyed.');
  source.destroy();
  print('Source destroyed.');
  ctx.destroy();
  print('Context destroyed.');
  synthizer.shutdown();
  print('Done.');
}
5
likes
130
points
241
downloads

Publisher

verified publisherbackstreets.site

Weekly Downloads

Dart bindings for the Synthizer sound library.

Repository

Documentation

API reference

License

Unlicense (license)

Dependencies

ffi, meta, path, quiver

More

Packages that depend on dart_synthizer