microphone_flutter 0.0.1 copy "microphone_flutter: ^0.0.1" to clipboard
microphone_flutter: ^0.0.1 copied to clipboard

Microphone recording for Flutter with the goal of no additional system dependencies. Integrates the `microphone_dart` package and uses cargokit to build the native Rust audio library and use it via FFI.

microphone_flutter #

Flutter integration for microphone_dart: cross-platform microphone capture with the goal of no system dependencies for users or devs to install.

This package builds the shared microphone Rust crate automatically (via cargokit) and bundles it with your app, then re-exports the full microphone_dart API.

import 'package:microphone_flutter/microphone_flutter.dart';

await MicrophoneFlutter.ensureInitialized();
if (await Microphone.requestPermission()) {
  final recording = await Microphone.record();
  // ... later ...
  final wav = await recording.stop();
}

Permissions #

The microphone is a protected resource; declare it in your app:

  • macOS / iOS: add NSMicrophoneUsageDescription to Info.plist. On macOS also enable the audio-input entitlement (com.apple.security.device.audio-input) for sandboxed apps.
  • Android: add <uses-permission android:name="android.permission.RECORD_AUDIO"/> to AndroidManifest.xml.

The OS prompts on first capture; the web backend prompts via getUserMedia. See the example app for working configuration.

Precompiled binaries #

Building requires Rust (rustup). To remove even that for consumers, the repo is set up for cargokit precompiled binaries:

  • native/microphone/cargokit.yaml holds the public signing key and the release URL prefix.
  • A release workflow builds and uploads signed binaries to precompiled_<crate-hash> releases on tag pushes. It needs a CARGOKIT_PRIVATE_KEY repository secret: the hex private key printed by dart run build_tool gen-key (keep it secret; never commit it).

Once a release exists, consuming builds download the matching signed binary instead of invoking cargo; with none present, cargokit builds from source.

0
likes
150
points
72
downloads

Documentation

API reference

Publisher

verified publishermanymath.com

Weekly Downloads

Microphone recording for Flutter with the goal of no additional system dependencies. Integrates the `microphone_dart` package and uses cargokit to build the native Rust audio library and use it via FFI.

Repository (GitHub)
View/report issues

Topics

#audio #microphone #recording #ffi

License

MIT (license)

Dependencies

flutter, microphone_dart

More

Packages that depend on microphone_flutter

Packages that implement microphone_flutter