Giter Club home page Giter Club logo

record's Introduction

Audio recorder from microphone to a given file path or stream.

No external dependencies:

  • On Android, AudioRecord and MediaCodec.
  • On iOS and macOS, AVFoundation.
  • On Windows, MediaFoundation.
  • On web, well... your browser! (and its underlying platform).

External dependencies:

  • On linux, encoding is provided by fmedia. It must be installed separately.

Platform feature parity matrix

Feature Android iOS web Windows macOS linux
pause/resume ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
amplitude(dBFS) ✔️ ✔️ ✔️ ✔️ ✔️
permission check ✔️ ✔️ ✔️ ✔️
num of channels ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
device selection (auto BT/mic) ✔️ ✔️ ✔️ ✔️
auto gain ✔️ (always active?) ✔️
echo cancel ✔️ ✔️
noise suppresion ✔️ ✔️

Bluetooth is not supported on Android at this time.

File

Encoder Android iOS web Windows macOS linux
aacLc ✔️ ✔️ ? ✔️ ✔️ ✔️
aacEld ✔️ ✔️ ? ✔️
aacHe ✔️ ? ✔️
amrNb ✔️ ? ✔️
amrWb ✔️ ?
opus ✔️ ✔️ ✔️
wav ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
flac ✔️ ✔️ ? ✔️ ✔️ ✔️
pcm16bits ✔️ ✔️ ✔️ ✔️ ✔️

* Question marks (?) in web column mean that the formats are supported by the plugin but are not available in current (and tested) browsers (Chrome / Firefox).

Stream

Encoder Android iOS web Windows macOS linux
aacLc * ✔️
aacEld * ✔️
aacHe * ✔️
pcm16bits ✔️ ✔️ ✔️ ✔️ ✔️

* AAC is streamed with raw AAC with ADTS headers, so it's directly readable through a file!

All audio output is with 16bits depth.

Usage

import 'package:record/record.dart';

final record = AudioRecorder();

// Check and request permission if needed
if (await record.hasPermission()) {
  // Start recording to file
  await record.start(const RecordConfig(), path: 'aFullPath/myFile.m4a');
  // ... or to stream
  final stream = await record.startStream(const RecordConfig(AudioEncoder.pcm16bits));
}

// Stop recording...
final path = await record.stop();
// ... or cancel it (and implicitly remove file/blob).
await record.cancel();

record.dispose(); // As always, don't forget this one.

Setup, permissions and others

Android

<uses-permission android:name="android.permission.RECORD_AUDIO" />
  • min SDK: 21 (amrNb/amrWb: 26, Opus: 29)

iOS

<key>NSMicrophoneUsageDescription</key>
<string>Some message to describe why you need this permission</string>
  • min SDK: 11.0

macOS

<key>NSMicrophoneUsageDescription</key>
<string>Some message to describe why you need this permission</string>
  • In capabilities, activate "Audio input" in debug AND release schemes.
  • or directly in *.entitlements files
<key>com.apple.security.device.audio-input</key>
<true/>
  • min SDK: 10.15

record's People

Contributors

llfbandit avatar alexobviously avatar sirusdoma avatar evertonmjunior avatar frananleo avatar pallopmax avatar sg5506844 avatar toyozaki avatar youssefali424 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.