Skip to content

Conversation

@madebymozart
Copy link
Collaborator

This CL adds the ability for the user to use the setBufferSizeInFrames method to allow for them to adjust the buffer size during PCM offload.


// If the requested size is 0 (Default/Auto), use the maximum capacity.
if (targetFrames <= 0) {
targetFrames = mAudioStream->getBufferCapacityInFrames();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use maximum. If the value is not valid, just return failure.

)

Text(
text = if (!isPlaying) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buffer size can also be set while actively playing.

@madebymozart madebymozart requested a review from flamme December 18, 2025 19:15
}

// Determine target size: Use maximum capacity if 0 or less is requested.
const int32_t capacity = mAudioStream->getBufferCapacityInFrames();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No needed

value = sliderPosition,
onValueChange = { newValue ->
sliderPosition = newValue
requestedFrames.intValue = (sliderPosition * sampleRate).toInt()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should limit to the buffer capacity instead of sample rate. The buffer size for PCM offload can be more than 1 second.

@madebymozart madebymozart merged commit 910b422 into main Dec 18, 2025
2 checks passed
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.

3 participants