Skip to content

streamBufferSize not working. #559

@ziyad-aljohani

Description

@ziyad-aljohani

Package version

  • record: ^6.1.2

Environment

  • OS: iOS 26

Describe the bug
The record package consistently returns audio chunks of 3200 bytes (100ms delay) on iOS, regardless of the streamBufferSize configuration. This causes unacceptable latency for a real-time voice changer application that requires 30ms or less latency for imperceptible audio processing.

Record Configuration:

const config = RecordConfig(
  encoder: AudioEncoder.pcm16bits,
  sampleRate: 16000,
  numChannels: 1,
  autoGain: false,
  echoCancel: false,
  noiseSuppress: false,
  androidConfig: AndroidRecordConfig(audioSource: AndroidAudioSource.mic),
  streamBufferSize: 2048,
);

To Reproduce
Steps to reproduce the behavior:

  1. Create a RecordConfig with streamBufferSize: 2048 (or any value less than 3200)
  2. Start recording with streaming enabled on an iOS device
  3. Listen to the audio stream chunks
  4. Observe that each chunk is consistently 3200 bytes regardless of the configured streamBufferSize

Expected behavior
The audio stream should return chunks matching the configured streamBufferSize parameter. For a real-time voice changer requiring ≤30ms latency, the chunk size should be approximately 960 bytes or less (30ms at 16kHz mono PCM16). The streamBufferSize parameter should control the actual buffer size returned by the stream.

Additional context

  • This issue only occurs on iOS platform
  • The streamBufferSize parameter appears to have no effect on the actual chunk size returned
  • Current behavior: 3200 bytes = 100ms latency (too high for real-time voice changing)
  • Required: ≤960 bytes = ≤30ms latency for imperceptible real-time processing
  • For professional real-time voice changing applications, latency above 30ms creates noticeable delay and poor user experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions