Skip to content

Conversation

@hamirmahal
Copy link
Contributor

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
Contributor 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
Contributor Author

You’re welcome!

@ftnext ftnext merged commit c87f5da into Uberi:master Sep 13, 2025
8 checks passed
@hamirmahal hamirmahal deleted the feat/additional-type-inference-for-consumers branch September 14, 2025 05:12
@ftnext ftnext changed the title feat: add additional type inference for consumers docs: add additional type inference for consumers Sep 14, 2025
ftnext added a commit that referenced this pull request Sep 14, 2025
…e-840

docs: add additional type hints (follow up #840)
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