flutter_audio_capture 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new52

flutter_audio_capture #

Capture the audio stream buffer through microphone for iOS/Android. Required OS version is iOS 12+ or Android 23+

Getting Started #

Add this line to your pubspec.yaml file:

  flutter_audio_capture: ^0.0.1

and execute

$ flutter pub get

If you want to use this package on Android OS, you need to set RECORD_AUDIO permission to AndroindManifest.xml like below.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  // Add this line
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>

If you want to use this package on iOS, you need to set NSMicrophoneUsageDescription to Info.plist like below.

    <string>Need microphone access to capture audio</string>

Example #

You can see full example in example/lib/main.dart

import 'package:flutter_audio_capture/flutter_audio_capture.dart';

// Callback function if device capture new audio stream.
// argument is audio stream buffer captured through mictophone.
// Currentry, you can only get is as Float64List.
void listener(dynamic obj) {
  var buffer = Float64List.fromList(obj.cast<double>());

// Callback function if flutter_audio_capture failure to register
// audio capture stream subscription.
void onError(Object e) {


FlutterAudioCapture plugin = new FlutterAudioCapture();
// Start to capture audio stream buffer
// sampleRate: sample rate you want (Android only)
// bufferSize: buffer size you want (iOS only)
await plugin.start(listener, onError, sampleRate: 16000, bufferSize: 3000);
// Stop to capture audio stream buffer
await plugin.stop();

0.0.1 #

  • TODO: Describe initial release.


import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter_audio_capture/flutter_audio_capture.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  FlutterAudioCapture _plugin = new FlutterAudioCapture();

  void initState() {

  Future<void> _startCapture() async {
    await _plugin.start(listener, onError, sampleRate: 16000, bufferSize: 3000);

  Future<void> _stopCapture() async {
    await _plugin.stop();

  void listener(dynamic obj) {

  void onError(Object e) {

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Audio Capture Plugin'),
        body: Column(children: [
              child: Row(
            children: [
                  child: Center(
                      child: FloatingActionButton(
                          onPressed: _startCapture, child: Text("Start")))),
                  child: Center(
                      child: FloatingActionButton(
                          onPressed: _stopCapture, child: Text("Stop")))),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_audio_capture: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_audio_capture/flutter_audio_capture.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-1 points)

6 out of 6 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
mockito ^4.1.1