mic_stream 0.1.1

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

mic_stream #

[Flutter Plugin] Provides a tool to get the microphone input as Byte Stream (Stream<Uint8List>)

About mic_stream: #

As Flutter still lacks some functionality, this plugin aims to provide the possibility to easily get an audio stream from the microphone, using a simple java implementation [=> Android only, iOS Support planned in the future].

How to use: #

The plugin provides one method:

Stream<Uint8List> microphone({options})

Listening to this stream starts the audio recorder while cancelling the subscription stops the stream.

Example: #

// Init a new Stream
Stream<Uint8List> stream = microphone(sampleRate: 44100);

// Start listening to the stream
StreamSubscription<Uint8List> listener = stream.listen((samples) => print(samples));

// Cancel the subscription
listener.cancel()

Flutter #

About Flutter Plugins: https://flutter.io/developing-packages/

Flutter Documentation: https://flutter.io/docs

0.0.1 #

Initial release - Android support only!

Provides the Class Microphone inheriting StreamController<T> with .start() and .stop() to start and stop sending an audio stream from the microphone to the Microphone's internal Stream (Microphone.stream). Also provides Microphone,broadcast which works the same but allows multiple StreamSubscriptions. On start, a timestamp is set and returned on stop.

Constructor takes the Sample Rate as optional argument.

Provides methods to: #
  • platformVersion: Getter to return current platform version
  • bufferSize: Getter to return current buffer size (calculated from the sample size)
  • isRecording: Returns the state of the class
  • sampleRate: Setter to manually update the sample rate (use with caution, though)
  • close: Closes the internal StreamController
  • toString: Pass-through to internal StreamController

0.0.2 #

  • Getter for internal stream: microphone.stream

0.0.3 #

  • pause: Pauses writing data to the stream
  • resume: Resumes a paused stream

0.0.4 #

  • Changed Values for default and maximum sample rate (to 32 kHZ and 48 kHZ, respectively)

0.0.5 #

  • Setter for microphone (audioSource, sampleRate, channelConfig, audioFormat)

0.0.6 #

  • Smaller changes

0.0.7 #

  • Fixed crucial bug from 0.0.6

0.0.8 #

  • Calculations of durations, as multi-threading currently makes it not working. Will be included in future releases
  • Some unit tests (Will be extended in the future to fully ensure the plugin's working)

0.1.0 #

  • Rewritten Plugin to make use of EventChannel.StreamHandlers (Much nicer than before)

microphone({Options}) returns a Stream<List<int>> The stream starts upon onListen() and runs until onCancel()

listen to the stream to start recording stop the subscription to stop

0.1.1 #

  • Added customisability for the recorder
  • Added some error handling of the input params

example/README.md

mic_stream_example #

Demonstrates how to use the mic_stream 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:
  mic_stream: ^0.1.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:mic_stream/mic_stream.dart';
  
Version Uploaded Documentation Archive
0.1.1 Mar 19, 2019 Go to the documentation of mic_stream 0.1.1 Download mic_stream 0.1.1 archive
0.1.0 Mar 19, 2019 Go to the documentation of mic_stream 0.1.0 Download mic_stream 0.1.0 archive
0.0.8 Mar 6, 2019 Go to the documentation of mic_stream 0.0.8 Download mic_stream 0.0.8 archive
0.0.7 Mar 1, 2019 Go to the documentation of mic_stream 0.0.7 Download mic_stream 0.0.7 archive
0.0.6 Mar 1, 2019 Go to the documentation of mic_stream 0.0.6 Download mic_stream 0.0.6 archive
0.0.5 Feb 27, 2019 Go to the documentation of mic_stream 0.0.5 Download mic_stream 0.0.5 archive
0.0.4 Feb 26, 2019 Go to the documentation of mic_stream 0.0.4 Download mic_stream 0.0.4 archive
0.0.3 Feb 26, 2019 Go to the documentation of mic_stream 0.0.3 Download mic_stream 0.0.3 archive
0.0.2 Feb 25, 2019 Go to the documentation of mic_stream 0.0.2 Download mic_stream 0.0.2 archive
0.0.1 Feb 25, 2019 Go to the documentation of mic_stream 0.0.1 Download mic_stream 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
46
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14
  • Flutter: 1.3.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

23 out of 23 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.

Format lib/mic_stream.dart.

Run flutter format to format lib/mic_stream.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
permission ^0.1.1 0.1.1
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