audio_streams 1.0.0+2

audio_streams #

Support for Audio Streams in Flutter. Capable of streaming Linear PCM format with a bit depth of 16 bits and 32 bits. Streams microphone audio data as Stream<List

iOS only for now!

Make sure that your App is created with Swift support! If not, then create a new empty project with swift support, by using the following command:

flutter create -i swift <project_name>

Then, copy over all your .dart files, assets & pubspec

Stream Type #

Linear PCM with a configurable bit depth of 16 or 32 bits

Installation #

Open pubspec.yaml and add audio_streams as a dependency

iOS #

Add a row to the following file ios/Runner/Info.plist and put in the key for the microphone

<key>NSMicrophoneUsageDescription</key>
<string>stream from microphone?</string>

Android #

Not Supported

Example #

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

import 'package:audio_streams/audio_streams.dart';

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

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

class _MyAppState extends State<MyApp> {
  AudioController controller;

  @override
  void initState() {
    super.initState();
    controller = new AudioController(CommonFormat.Int16, 16000, 1, true);
    initAudio();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initAudio() async {
    await controller.intialize();
    controller.startAudioStream().listen((onData) {
      print(onData);
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
      ),
    );
  }
}

1.0.0+2 #

  • Updated README in example and main

1.0.0+1 #

  • Changed Description and README

1.0.0 #

  • Initial Version
  • Ability to create Audio Streams

example/README.md

audio_streams_example #

Demonstrates how to use the audio_streams plugin.

Use this package as a library

1. Depend on it

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


dependencies:
  audio_streams: ^1.0.0+2

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_streams/audio_streams.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
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]
76
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

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.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test