audio_io 0.0.1 copy "audio_io: ^0.0.1" to clipboard
audio_io: ^0.0.1 copied to clipboard

outdated

Simple PCM audio data streamed into dart, and or out from dart.

example/lib/main.dart

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

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

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

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

class _MyAppState extends State<MyApp> {
  String _status = 'Unknown';

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    try {
      await AudioIo.instance.start();
       _status = 'Started'; 
    } on PlatformException {
      _status = 'Failed';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.

    AudioIo.instance.input.listen((data){
      AudioIo.instance.output.add(data);
    });

    if (!mounted) return;
      setState(() {
            _status = _status;
          });
   
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running: $_status\n'),
        ),
      ),
    );
  }
}
3
likes
0
pub points
27%
popularity

Publisher

verified publisherwearemobilefirst.com

Simple PCM audio data streamed into dart, and or out from dart.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on audio_io