flutter-voice-processor

A Flutter plugin for real-time voice processing.

Usage

Create:

int frameLength = 512;
int sampleRate = 16000;
VoiceProcessor _voiceProcessor = VoiceProcessor.getVoiceProcessor(frameLength, sampleRate);
Function _removeListener = _voiceProcessor.addListener((buffer) {
    print("Listener received buffer of size ${buffer.length}!");
});

Start audio:

try {
    if (await _voiceProcessor.hasRecordAudioPermission()) {
        await _voiceProcessor.start();    
    } else {
        print("Recording permission not granted");
    }
} on PlatformException catch (ex) {
    print("Failed to start recorder: " + ex.toString());
}

Stop audio:

await _voiceProcessor.stop();
_removeListener();

Libraries

flutter_voice_processor