Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add useMicrophone hook

Đang mở
#2,676 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

@Shahab-16 đang làm issue này rồi.

Từ ngày 17/12/2025.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
react, typescript
Lĩnh vực
audio-video-rtc, frontend

Hướng nghiên cứu

Start by reviewing the repository's existing React hook patterns, then trace the browser getUserMedia and MediaStream APIs named in the issue. Implement the proposed stream, granted, error, start, and stop behavior with cleanup on unmount; done means permission and capture lifecycle behavior matches the requested API.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem? Please describe.
Accessing the microphone in React requires verbose boilerplate — handling permissions, creating MediaStream, managing cleanup, and dealing with browser quirks.

Describe the solution you'd like
Add a useMicrophone hook:

const { stream, granted, error, start, stop } = useMicrophone({
  constraints: { audio: true },
});

start() requests permission and begins capture.
stop() stops and releases the mic.
stream is the live MediaStream.

Automatically cleans up on unmount.

Describe alternatives you've considered
Manual getUserMedia usage or small third-party hooks — both repetitive and less reliable.

I would love to implement the hook if you believe it's a good fit for the library.

Ngôn ngữ chính
TypeScript
Star
44k
Fork
3.3k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của streamich/react-use

Tất cả issue của streamich/react-use

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.