minisound 2.0.1 copy "minisound: ^2.0.1" to clipboard
minisound: ^2.0.1 copied to clipboard

retracted

A high-level real-time audio playback library based on Miniaudio.

example/lib/main.dart

import "package:example/widgets/generation_example.dart";
import "package:example/widgets/playback_example.dart";
import "package:example/widgets/recording_example.dart";
import "package:flutter/material.dart";
import "package:minisound/engine.dart";
import "package:minisound/recorder.dart";

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  runApp(const MaterialApp(title: "Minisound Example", home: ExamplePage()));
}

class ExamplePage extends StatefulWidget {
  const ExamplePage({super.key});

  @override
  State<ExamplePage> createState() => _ExamplePageState();
}

class _ExamplePageState extends State<ExamplePage> {
  final engine = Engine();
  final recorder = Recorder();

  late final initFuture = engine.init().then((_) => recorder.init());

  @override
  Widget build(BuildContext context) {
    const space = SizedBox.square(dimension: 20);
    return Scaffold(
      appBar: AppBar(title: const Text("Minisound Example")),
      body: Center(
        child: SingleChildScrollView(
          child: FutureBuilder(
            future: initFuture,
            builder: (_, snapshot) => switch (snapshot) {
              AsyncSnapshot(
                connectionState: ConnectionState.done,
                hasError: false
              ) =>
                Column(children: [
                  PlaybackExample(engine),
                  space,
                  GenerationExample(engine),
                  space,
                  RecordingExample(recorder, engine: engine),
                ]),
              AsyncSnapshot(connectionState: ConnectionState.waiting) =>
                const Center(child: CircularProgressIndicator()),
              AsyncSnapshot(:final error) =>
                Center(child: Text("Error: $error")),
            },
          ),
        ),
      ),
    );
  }
}
9
likes
0
pub points
67%
popularity

Publisher

unverified uploader

A high-level real-time audio playback library based on Miniaudio.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_web_plugins, minisound_ffi, minisound_platform_interface, minisound_web

More

Packages that depend on minisound