Flutter: How to get the microphone's raw audio signal into memory in real time?


Well, the title says it all. The idea is to monitor ambient noise. As soon as a certain pattern is detected, the audio signal should be recorded to a file. The difficulty is that the recorded file should start a few seconds before the pattern is detected. Hence the audio signal is needed in memory to be able to "go back" a few seconds. Do you have any ideas how to get the raw audio input into memory in real time?


you can use the flutter sound plugin to get the microphone’s raw audio signal into memory in real-time.
reference link is:
and demo example is here https://github.com/dooboolab/flutter_sound/blob/master/example/lib/demo_util/demo3_body.dart

I have one example is

Widget _buildRecorder(Track track) {
    return Padding(
        padding: const EdgeInsets.all(8.0),
        child: RecorderPlaybackController(
            child: Column(
          children: [
            Left("Recording Playback"),
              enabled: false,
              showTitle: true,
              audioFocus: true
                  ? AudioFocus.requestFocusAndDuckOthers
                  : AudioFocus.requestFocusAndDuckOthers,


Answered By – Abhishek Ghaskata

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.