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

Work on a take api #32

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Work on a take api #32

merged 3 commits into from
Nov 22, 2024

Conversation

xd009642
Copy link
Member

A potential approach for #31 this provides an API so users can do a thing

Take will take audio out of the session audio buffer and adjust the start time of the segments to match - this is mostly for compat/UX. The main focus of this is to allow someone to evacuate some audio and shorten existing segments in case they're accruing an ever larger vector of audio samples while someone is nattering on.

I also did some cleanup of the code mainly:

  1. speech_end_ms was only set in one place and set to None at the end of the block
  2. Move out duration -> index into separate methods and add a panicking and non-panicking version
  3. Fix the bad asserts in get_current_audio where underflow could mess things up

Take will take audio out of the session audio buffer and adjust the
start time of the segments to match - this is mostly for compat/UX.
The main focus of this is to allow someone to evacuate some audio and
shorten existing segments in case they're accruing an ever larger
vector of audio samples while someone is nattering on.

I also did some cleanup of the code mainly:

1. speech_end_ms was only set in one place and set to `None` at the end
of the block
2. Move out duration -> index into separate methods and add a panicking
and non-panicking version
3. Fix the bad asserts in `get_current_audio` where underflow could mess
things up
Copy link
Member

@blueridanus blueridanus left a comment

Choose a reason for hiding this comment

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

looks good
we might want to consider vecdeque

@xd009642 xd009642 merged commit 507d5a8 into main Nov 22, 2024
1 check passed
@xd009642 xd009642 deleted the feat/take-api branch November 22, 2024 14:34
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.

3 participants