Picovoice Wordmark
Start Building
Introduction
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryPicovoice picoLLMGPTQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice LeopardAmazon TranscribeAzure Speech-to-TextGoogle ASRGoogle ASR (Enhanced)IBM Watson Speech-to-TextWhisper Speech-to-Text
FAQ
Introduction
AndroidC.NETFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustWeb
SummaryPicovoice Cheetah
FAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidC.NETiOSNode.jsPythonWeb
SummaryAmazon PollyAzure TTSElevenLabsOpenAI TTSPicovoice Orca
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice KoalaMozilla RNNoise
Introduction
AndroidCiOSLinuxmacOSNode.jsPythonRaspberry PiWebWindows
AndroidCNode.jsPythoniOSWeb
SummaryPicovoice EaglepyannoteSpeechBrainWeSpeaker
Introduction
AndroidCiOSLinuxmacOSPythonRaspberry PiWebWindows
AndroidCiOSPythonWeb
SummaryPicovoice FalconAmazon TranscribeAzure Speech-to-TextGoogle Speech-to-Textpyannote
Introduction
AndroidArduinoCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSMicrocontrollerNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaMicrocontrollerNode.jsPythonReactReact NativeRustUnityWeb
SummaryPorcupineSnowboyPocketSphinx
Wake Word TipsFAQ
Introduction
AndroidCChrome.NETEdgeFirefoxFlutteriOSJavaLinuxmacOSNode.jsPythonRaspberry PiReactReact NativeRustSafariUnityWebWindows
AndroidC.NETFlutteriOSJavaNode.jsPythonReactReact NativeRustUnityWeb
SummaryPicovoice RhinoGoogle DialogflowAmazon LexIBM WatsonMicrosoft LUIS
Expression SyntaxFAQ
Introduction
AndroidC.NETiOSLinuxmacOSNode.jsPythonRaspberry PiRustWebWindows
AndroidC.NETiOSNode.jsPythonRustWeb
SummaryPicovoice CobraWebRTC VAD
FAQ
Introduction
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
AndroidC.NETFlutteriOSNode.jsPythonReact NativeRustUnityWeb
Introduction
C.NETNode.jsPython
C.NETNode.jsPython
FAQGlossary

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

  1. Install Flutter SDK.

  2. Run flutter doctor to determine any missing requirements.

  3. Add the flutter_voice_processor plugin to your app project by referencing it in pubspec.yaml:

dependencies:
flutter_voice_processor: ^<version>
  1. 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:

<key>NSMicrophoneUsageDescription</key>
<string>[Permission explanation]</string>

Android

Open your AndroidManifest.xml and add the following line:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

Usage

Access the singleton instance of VoiceProcessor:

import 'package:flutter_voice_processor/flutter_voice_processor.dart';
VoiceProcessor? _voiceProcessor = VoiceProcessor.instance;

Add listeners for audio frames and errors:

VoiceProcessorFrameListener frameListener = (List<int> frame) {
// use audio
}
VoiceProcessorErrorListener errorListener = (VoiceProcessorException error) {
// handle error
}
_voiceProcessor?.addFrameListener(frameListener);
_voiceProcessor?.addErrorListener(errorListener);

Ask for audio record permission and start recording with the desired frame length and audio sample rate:

final int frameLength = 512;
final int sampleRate = 16000;
if (await _voiceProcessor?.hasRecordAudioPermission() ?? false) {
try {
await _voiceProcessor?.start(frameLength, sampleRate);
} on PlatformException catch (ex) {
// handle start error
}
} else {
// user did not grant permission
}

Stop audio recording and remove listeners:

try {
await _voiceProcessor?.stop();
} on PlatformException catch (ex) {
// handle stop error
}

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:

VoiceProcessorFrameListener listener1 = (frame) { }
VoiceProcessorFrameListener listener2 = (frame) { }
List<VoiceProcessorFrameListener> listeners = [listener1, listener2];
_voiceProcessor?.addFrameListeners(listeners);
_voiceProcessor?.removeFrameListeners(listeners);
// or
_voiceProcessor?.clearFrameListeners();

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:

git clone https://github.com/Picovoice/flutter-voice-processor.git

Usage

  1. Install dependencies and setup environment:
cd example
flutter pub get
  1. Connect a mobile device or launch a simulator. Then build and run the app:
flutter run
  1. 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.

Resources

Package

  • flutter_voice_processor on the pub.dev

API

  • flutter_voice_processor API Docs

GitHub

  • Voice Processor Flutter SDK on GitHub
  • Voice Processor Flutter Demo on GitHub

Was this doc helpful?

Issue with this doc?

Report a GitHub Issue
Audio Recording Flutter Quick Start
  • Platforms
  • Requirements
  • Quick Start
  • Setup
  • Usage
  • Demo
  • Setup
  • Usage
  • Resources
Voice AI
  • Leopard Speech-to-Text
  • Cheetah Streaming Speech-to-Text
  • Orca Text-to-Speech
  • Koala Noise Suppression
  • Eagle Speaker Recognition
  • Falcon Speaker Diarization
  • Porcupine Wake Word
  • Rhino Speech-to-Intent
  • Cobra Voice Activity Detection
Local LLM
  • picoLLM Inference
  • picoLLM Compression
  • picoLLM GYM
Resources
  • Docs
  • Console
  • Blog
  • Use Cases
  • Playground
Sales & Services
  • Consulting
  • Foundation Plan
  • Enterprise Plan
  • Enterprise Support
Company
  • About us
  • Careers
Follow Picovoice
  • LinkedIn
  • GitHub
  • X
  • YouTube
  • AngelList
Subscribe to our newsletter
Terms of Use
Privacy Policy
© 2019-2025 Picovoice Inc.