Audio Recording
Flutter Quick Start
Platforms
- Flutter (1.20.0+)
- Android (5.0+, API 21+)
- iOS (11.0+)
Requirements
- Flutter SDK
- Android SDK (21+)
- JDK (8+)
- Xcode (11+)
- CocoaPods
Quick Start
Setup
Install Flutter SDK.
Run
flutter doctor
to determine any missing requirements.Add the
flutter_voice_processor
plugin to your app project by referencing it inpubspec.yaml
:
- Enable the proper permission for recording with the hardware's microphone on both iOS and Android:
iOS
Open your Info.plist and add the following line:
Android
Open your AndroidManifest.xml and add the following line:
Usage
Access the singleton instance of VoiceProcessor
:
Add listeners for audio frames and errors:
Ask for audio record permission and start recording with the desired frame length and audio sample rate:
Stop audio recording and remove listeners:
Once audio capture has started successfully, any frame listeners assigned to the VoiceProcessor
will start receiving audio frames with the given frameLength
and sampleRate
.
Capturing with Multiple Listeners
Any number of listeners can be added to and removed from the VoiceProcessor
instance. However,
the instance can only record audio with a single audio configuration (frameLength
and sampleRate
),
which all listeners will receive once a call to start()
has been made. To add multiple listeners:
Demo
For the Voice Processor Flutter SDK we have an example app that demonstrates how to use VoiceProcessor
in a Flutter app.
Setup
Clone the flutter-voice-processor repository from GitHub:
Usage
- Install dependencies and setup environment:
- Connect a mobile device or launch a simulator. Then build and run the app:
- Toggle recording on and off with the button in the center of the screen. While recording, the VU meter on the screen will respond to the volume of incoming audio.
For more information on our Voice Processor demo for Flutter, head over to our GitHub repository.