Skip to content

feat: add additional type inference for consumers #840

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 1 commit into
base: master
Choose a base branch
from

Conversation

hamirmahal
Copy link

Closes #839

Copy link
Collaborator

@ftnext ftnext left a comment

Choose a reason for hiding this comment

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

Thanks for this PR adding type hints.
I noticed you've annotated the source parameter as Microphone type, but according to the docstring, it should accept any AudioSource object.

Why did you choose to use Microphone specifically rather than the more general AudioSource type?
Could you please update the PR to use AudioSource instead, which would better reflect the actual parameter requirements?

Thanks for your work on improving the library's type hints.

@hamirmahal
Copy link
Author

You're welcome. I originally went with Microphone because that's the type I saw on hover when using this library as a consumer.

I'll push up a change that makes the type AudioSource. Thank you for your input.

@hamirmahal hamirmahal force-pushed the feat/additional-type-inference-for-consumers branch from ff586ea to c0902ec Compare May 11, 2025 22:20
@hamirmahal hamirmahal requested a review from ftnext May 11, 2025 22:20
Copy link
Collaborator

@ftnext ftnext left a comment

Choose a reason for hiding this comment

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

Thanks!

@hamirmahal
Copy link
Author

You’re welcome!

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.

Add type hints for recognizer.listen and recognizer.adjust_for_ambient_noise so consumers can have some type safety
2 participants