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

outdated

Dart bindings for the Synthizer sound library.

example/dart_synthizer_example.dart

// ignore_for_file: avoid_print
/// The basics of Synthizer.
import 'dart:io';

import 'package:dart_synthizer/dart_synthizer.dart';

Future<void> main() async {
  final synthizer = Synthizer()..initialize();
  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 = true;
  source.addGenerator(generator);
  await Future<void>.delayed(Duration(seconds: 2));
  generator.destroy();
  print('Generator destroyed.');
  source.destroy();
  print('Source destroyed.');
  ctx.destroy();
  print('Context destroyed.');
  synthizer.shutdown();
  print('Done.');
}
4
likes
0
pub points
28%
popularity

Publisher

verified publisherbackstreets.site

Dart bindings for the Synthizer sound library.

Repository

License

unknown (LICENSE)

Dependencies

ffi, meta, quiver

More

Packages that depend on dart_synthizer