Skip to content

Fix Audio Subscription Cancellation and Stream Handling #151

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

myfeng10
Copy link

This PR fixes an issue where the audio recorder was not properly canceled after disconnecting from Hume AI, causing lag when reconnecting. The solution ensures _audioSubscription?.cancel(); is called on disconnect to prevent multiple active subscriptions.

Additionally, a condition was added to stop data from being added to the recorder stream after disconnection, reducing excessive error messages. These changes improve performance, prevent lag, and ensure proper resource management.

Fix audio subscription cancellation
stop data from being added to the recorder stream after disconnection
Copy link
Contributor

@twitchard twitchard left a comment

Choose a reason for hiding this comment

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

This looks great! Thank you

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.

2 participants