Default value of the sample_rate for Microphone differs between the reference and the implementation

Open Beginner friendly
#617 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Compare the Microphone reference entry in reference/library-reference.rst with the implementation at speech_recognition/init.py around line 73. Update the reference description so its sample_rate default matches the implementation, then verify the documented signature reflects None.

Written by the indexing model from the issue text.

Description

Steps to reproduce

This is a documentation error.

Expected behaviour

The reference description should be sample_rate: Union[int, None] = None

Actual behaviour

Reference

https://github.com/Uberi/speech_recognition/blob/3.8.1/reference/library-reference.rst#microphonedevice_index-unionint-none--none-sample_rate-int--16000-chunk_size-int--1024---microphone

sample_rate: int = 16000

Implementation

https://github.com/Uberi/speech_recognition/blob/3.8.1/speech_recognition/__init__.py#L73

sample_rate=None

System information

Dominant language
Python
Stars
9k
Forks
2.4k
Avg merge
12h 24m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Uberi/speech_recognition

All issues in Uberi/speech_recognition

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.