audio_streams 1.0.1 copy "audio_streams: ^1.0.1" to clipboard
audio_streams: ^1.0.1 copied to clipboard

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<Int>>.

example/lib/main.dart

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'),
        ),
      ),
    );
  }
}
8
likes
40
pub points
0%
popularity

Publisher

verified publisherrishabnayak.com

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<Int>>.

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on audio_streams