Skip to content

Conversation

@roderickvd
Copy link
Member

Add buffer_size() method to Stream trait that returns the number of frames passed to each data callback invocation (actual size or upper limit depending on platform).

AAudio improvements:

  • BufferSize::Default now explicitly configures using optimal burst size from AudioManager, following Android low-latency audio best practices
  • buffer_size() query falls back to burst size if frames_per_data_callback was not explicitly set
  • Refactored buffer configuration to eliminate code duplication

Addresses #1042
Relates to #964, #942

Add buffer_size() method to Stream trait that returns the number of
frames passed to each data callback invocation (actual size or upper
limit depending on platform).

AAudio improvements:
- BufferSize::Default now explicitly configures using optimal burst size
  from AudioManager, following Android low-latency audio best practices
- buffer_size() query falls back to burst size if frames_per_data_callback
  was not explicitly set
- Refactored buffer configuration to eliminate code duplication

Addresses #1042
Relates to #964, #942
Replace `Stream` enum with a struct containing `inner: Arc<Mutex<AudioStream>>`
and `direction: DeviceDirection` fields. This eliminates code duplication while
maintaining the same functionality.
@roderickvd roderickvd force-pushed the feat/query-buffer-size branch from 60a92a5 to 401e5b9 Compare December 23, 2025 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants