fynkel_audio 0.1.0
fynkel_audio: ^0.1.0 copied to clipboard
Sound for Fynkel games. Clips, sources, a listener, music and groups, as in Unity, with 3D sound.
import 'package:fynkel/fynkel.dart';
import 'package:fynkel_audio/fynkel_audio.dart';
/// A thing that hums, louder the nearer the camera is.
class Humming extends GameObject {
@override
Future<void> onLoad() async {
await super.onLoad();
add(
GameObject(
components: [
AudioSource(clip: await assets.audio('hum.ogg'), loop: true, spatialBlend: 1, maxDistance: 25),
],
),
);
}
}