Skip to content
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

Fix start time logic for file loading #195

Merged
merged 2 commits into from
Aug 10, 2024

Conversation

ZachNagengast
Copy link
Contributor

Resolves #191

Issue occurs when an audio file requires resampling and startTime is not 0. Previously, the resample function calculated the total frame count and reading up to that number as the frame position (which would imply that the start time was always 0 in the resample function). The solution involves calculating the start and end frame positions by incorporating the starting frame position as an offset and reading up to the end position correctly rather than just the total frame count.

  • Correctly calculates starting frame position to read files when startTime is not 0
  • Adds new optional parameter to loadAudio protocol maxReadFrameSize for easier memory management with large files
  • Adds tests for this logic
  • Adds a couple minor QoL improvements for edge cases and logging

@ZachNagengast ZachNagengast merged commit c268c8d into main Aug 10, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

resampleAudio implementation has bug when starttime and enttime is not nil
1 participant