-
Notifications
You must be signed in to change notification settings - Fork 615
[Feature] Allow Users to setBufferSizeInFrames when in PCM Offload Mode #2332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| // If the requested size is 0 (Default/Auto), use the maximum capacity. | ||
| if (targetFrames <= 0) { | ||
| targetFrames = mAudioStream->getBufferCapacityInFrames(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| // Determine target size: Use maximum capacity if 0 or less is requested. | ||
| const int32_t capacity = mAudioStream->getBufferCapacityInFrames(); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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.
This CL adds the ability for the user to use the
setBufferSizeInFramesmethod to allow for them to adjust the buffer size during PCM offload.