internal_audio_recorder 0.1.1 internal_audio_recorder: ^0.1.1 copied to clipboard
A new Flutter plugin for android that record internal audio and output it as PCM file.
import 'package:flutter/material.dart';
import 'package:internal_audio_recorder/internal_audio_recorder.dart';
import 'package:internal_audio_recorder/model/audioformat.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final _internalAudioRecorderPlugin = InternalAudioRecorder();
@override
void initState() {
super.initState();
}
// Platform messages are asynchronous, so we initialize in an async method.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
MaterialButton(
color: Colors.green,
onPressed: () async {
var responce = await _internalAudioRecorderPlugin
.startCapturing("/", AudioFormat.encodingPCM16BIT, 44100);
print("Responce: $responce");
},
child: Text("Start Recording"),
),
MaterialButton(
color: Colors.green,
onPressed: () async {
var responce =
await _internalAudioRecorderPlugin.stopCapturing();
print("Responce: $responce");
},
child: Text("Stop Recording"),
),
],
),
),
),
);
}
}