alnitak / flutter_recorder

A low-level audio recorder plugin which uses miniaudio as backend and supporting all the platforms. It can detect silence and save to WAV audio file. Audio wave and FFT data can be get in real-time as for the volume level.
Apache License 2.0
20 stars 2 forks source link

docs: Hello, am trying to figure out how to use this package currently for voice notes and call streaming #11

Open jbarasa opened 1 day ago

jbarasa commented 1 day ago

Documentation Request for Recording Controls & Waveform Visualization

Hi, I'm currently implementing voice notes using flutter_recorder and need clarification on some core functionalities.

Current Implementation I'm using:

Documentation Needed For:

  1. Pause & Resume Recording

    • Is setPauseRecording(pause: boolean) the correct approach?
    • Are there any cleanup steps needed when resuming?
    • Does pausing affect the final file output?
  2. Waveform Visualization

    • What's the recommended polling frequency for getWave()?
    • What's the format of the wave data (range, number of points)?
    • Are there any performance considerations?
  3. Recording Management

    • Best practices for file handling during pause/resume
    • Recommended approach for recording timer implementation
    • Memory management considerations for longer recordings

Use Case Context: Building a voice notes feature that requires:

Documentation Request: Audio Configuration & Recording Features

  1. Audio Configuration

    _recorder.init(
     sampleRate: 44100,
     channels: RecorderChannels.stereo,
     format: PCMFormat.f32le,
    );
    • What are the recommended configuration settings for voice recording?
    • How to configure audio context for optimal voice recording quality?
    • Can we configure similar audio settings as shown below for the recorder?
      // Current player configuration - need equivalent for recorder
      await setAudioContext(AudioContext(
      android: AudioContextAndroid(
      contentType: AndroidContentType.speech,
      usageType: AndroidUsageType.media,
      audioFocus: AndroidAudioFocus.none,
      audioMode: AndroidAudioMode.normal,
      ),
      iOS: AudioContextIOS(
      category: AVAudioSessionCategory.playAndRecord,
      options: {
       AVAudioSessionOptions.defaultToSpeaker,
       AVAudioSessionOptions.allowBluetooth,
       AVAudioSessionOptions.allowBluetoothA2DP,
       AVAudioSessionOptions.mixWithOthers,
      },
      ),
      ));
  2. Feature Requirements

    • How to configure audio quality settings (bitrate, encoding)?
    • Best practices for handling bluetooth/headphone routing?
    • How to ensure optimal performance for:
      • Background recording
      • Long duration recordings
      • Pause/resume functionality
  3. Platform-Specific Considerations

    • Are there different configurations needed for iOS vs Android?
    • How to handle audio session interruptions?
    • Best practices for permission handling?

Would greatly appreciate examples or documentation covering these scenarios. Thank you!