audio_recorder_mc 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 68

audio_recorder_mc #

This is a flutter plugin for recording audio for Android and IOS. You can read the samples from the microphone and choose the desired sample rate..

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Setup #

iOS #

Then update your Info.plist with wanted permissions usage descriptions:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>

  <!-- 🚨 Keep only the permissions used in your app 🚨 -->

  <key>NSMicrophoneUsageDescription</key>
  <string>Need microphone access for recording</string>

  <!-- … -->

</dict>
</plist>

Android #

Add all wanted permissions to your app android/app/src/main/AndroidManifest.xml file:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.myawesomeapp">

  <!-- 🚨 Keep only the permissions used in your app 🚨 -->

  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

  <!-- … -->

</manifest>

1.0.0 #

  • TODO: First validated version.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:audio_recorder_mc/audio_recorder_mc.dart';

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

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

class _MyAppState extends State<MyApp> {
  bool isRecording = false;

  @override
  void initState() {
    super.initState();
  }

  var recorder = AudioRecorderMc(sampleRate: 8820);
  Stream<double> samples;

  void startRecord() {
    recorder.startRecord.then((stream) {
      setState(() {
        isRecording = true;
      });

      stream.listen((samples) {
        print(samples);
      });
    });
  }

  void stopRecord() {
    recorder.stopRecord.then((value) {
      setState(() {
        isRecording = false;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              RaisedButton(onPressed: () {
                                          this.isRecording ? stopRecord() : startRecord();
                                        },
                            child: Text(this.isRecording ? 'Stop' : 'Start')),
            ],
          )
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  audio_recorder_mc: ^1.0.0

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:audio_recorder_mc/audio_recorder_mc.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
41
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:audio_recorder_mc/audio_recorder_mc.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:audio_recorder_mc/audio_recorder_mc.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:audio_recorder_mc/audio_recorder_mc.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:audio_recorder_mc/audio_recorder_mc.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • audio_recorder_mc that is a package requiring null.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (permission_handler).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
permission_handler ^3.1.0 3.3.0 5.0.1+1
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test