flutter_record 0.3.6

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 89

DEPRECATED #

This is no longer supported, please consider using flutter_sound instead.

A flutter plugin for recorder audio and audio player.of course, you can cancel the recording.

pub version license github stars

Installation #

First, add flutter_record as a dependency in your pubspec.yaml file.

Run flutter packages get

iOS #

Add two rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Microphone Usage Description and a usage description.
  • and one with the key UIBackgroundModes and a usage description.
<key>NSMicrophoneUsageDescription</key>
<string>Can I use the mic please?</string>
<key>UIBackgroundModes</key>
<array>
	<string>audio</string>
</array>

Android #

configuration required - the plugin should work out of the box.

Example #

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

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

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  FlutterRecord _flutterRecord;
  double _volume = 0.0;
  int _duration = 0;

  @override
  void initState() {
    super.initState();
    initPlatformState();
    _flutterRecord = FlutterRecord();
  }

  Future<void> initPlatformState() async {
    String platformVersion;

    try {
      platformVersion = await FlutterRecord.platformVersion;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Plugin example app')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text('Running on: $_platformVersion\n'),
              SizedBox(height: 50.0),
              Text('$_volume'),
              FlatButton(
                child: Text('startRecorder'),
                onPressed: () async {
                  String path = await _flutterRecord.startRecorder(
                      path: 'test', maxVolume: 7.0);

                  print(path);

                  _flutterRecord.volumeSubscription.stream.listen((volume) {
                    setState(() {
                      _volume = volume;
                    });
                  });
                },
              ),
              FlatButton(
                child: Text('stopRecorder'),
                onPressed: () async {
                  await _flutterRecord.stopRecorder();
                },
              ),
              FlatButton(
                child: Text('cancelRecorder'),
                onPressed: () async {
                  await _flutterRecord.cancelRecorder();
                },
              ),
              FlatButton(
                child: Text('startPlayer'),
                onPressed: () async {
                  await _flutterRecord.startPlayer(path: 'test');
                  await _flutterRecord.setVolume(1.0);
                },
              ),
              FlatButton(
                child: Text('pausePlayer'),
                onPressed: () async {
                  await _flutterRecord.pausePlayer();
                },
              ),
              FlatButton(
                child: Text('stopPlay'),
                onPressed: () async {
                  await _flutterRecord.stopPlayer();
                },
              ),
              Text('$_duration'),
              FlatButton(
                child: Text('getDuration'),
                onPressed: () async {
                  final int duration =
                      await _flutterRecord.getDuration(path: 'test');
                  setState(() {
                    _duration = duration;
                  });
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}

0.3.6 #

  • fix: error: cannot create a single-element tuple with an element label

0.3.1 #

  • chore: update AndroidX Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.3.0 #

  • Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.2.0 #

  • fix: android setAudioSamplingRate setAudioChannels equal to ios

0.1.11 #

  • fix: android requestPermission api return value

0.1.9 #

  • feature: add requestPermission api

0.1.8 #

  • fix: fix ios build swift version error

0.1.3 #

  • add getBasePath api

0.1.2 #

  • remove recordSubscription and playSubscription from lib/flutter_record.dart.

0.1.1 #

  • Update README
  • feature: add pausePlayer api

0.0.1 #

  • TODO: Describe initial release.

example/README.md

flutter_record_example #

Demonstrates how to use the flutter_record plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

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

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_record: ^0.3.6

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_record/flutter_record.dart';
  
Version Uploaded Documentation Archive
0.3.7 Apr 25, 2019 Go to the documentation of flutter_record 0.3.7 Download flutter_record 0.3.7 archive
0.3.6 Apr 4, 2019 Go to the documentation of flutter_record 0.3.6 Download flutter_record 0.3.6 archive
0.3.5 Mar 22, 2019 Go to the documentation of flutter_record 0.3.5 Download flutter_record 0.3.5 archive
0.3.3 Mar 22, 2019 Go to the documentation of flutter_record 0.3.3 Download flutter_record 0.3.3 archive
0.3.2 Mar 22, 2019 Go to the documentation of flutter_record 0.3.2 Download flutter_record 0.3.2 archive
0.3.1 Feb 21, 2019 Go to the documentation of flutter_record 0.3.1 Download flutter_record 0.3.1 archive
0.3.0 Feb 13, 2019 Go to the documentation of flutter_record 0.3.0 Download flutter_record 0.3.0 archive
0.2.0+1 Jan 29, 2019 Go to the documentation of flutter_record 0.2.0+1 Download flutter_record 0.2.0+1 archive
0.2.0 Jan 29, 2019 Go to the documentation of flutter_record 0.2.0 Download flutter_record 0.2.0 archive
0.1.16 Jan 29, 2019 Go to the documentation of flutter_record 0.1.16 Download flutter_record 0.1.16 archive

All 28 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
78
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on May 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.16
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test