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.');
}
4
likes
110
pub points
32%
popularity

Publisher

verified publisherbackstreets.site

Dart bindings for the Synthizer sound library.

Repository
View/report issues

Documentation

API reference

License

Unlicense (LICENSE)

Dependencies

ffi, meta, path, quiver

More

Packages that depend on dart_synthizer