record 7.1.0 copy "record: ^7.1.0" to clipboard
record: ^7.1.0 copied to clipboard

Audio recorder from microphone to file or stream with multiple codecs, bit rate and sampling rate options.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:record_example/audio_player.dart';
import 'package:record_example/audio_recorder.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String? audioPath;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Stack(
            children: [
              Offstage(
                offstage: audioPath != null,
                child: Recorder(
                  onStop: (path) {
                    debugPrint('Recorded file path: $path');
                    setState(() => audioPath = path);
                  },
                ),
              ),
              if (audioPath != null)
                AudioPlayer(
                  source: audioPath!,
                  onDelete: () => setState(() => audioPath = null),
                ),
            ],
          ),
        ),
      ),
    );
  }
}
883
likes
160
points
654k
downloads

Documentation

API reference

Publisher

verified publishercow-level.ovh

Weekly Downloads

Audio recorder from microphone to file or stream with multiple codecs, bit rate and sampling rate options.

Repository (GitHub)
View/report issues

Topics

#audio #recorder #audio-recorder

License

BSD-3-Clause (license)

Dependencies

flutter, record_android, record_ios, record_linux, record_macos, record_platform_interface, record_web, record_windows

More

Packages that depend on record

Packages that implement record