-
-
Notifications
You must be signed in to change notification settings - Fork 44
Input selection + ios BT category fix #926
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds input device selection functionality to the audio API and fixes iOS Bluetooth category naming. The main purpose is to allow users to programmatically select audio input devices (e.g., switching between built-in microphone and Bluetooth devices) in response to issue #734.
Changes:
- Added
setInputDevicemethod to AudioManager for selecting input devices - Renamed iOS option from
allowBluetoothtoallowBluetoothHFPfor correct Bluetooth profile - Added
useAudioInputReact hook for managing input device selection with automatic updates on route changes
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-audio-api/tsconfig.json | Added module suffixes for better native/web resolution |
| packages/react-native-audio-api/src/web-system/AudioManager.ts | Added setInputDevice mock for web platform |
| packages/react-native-audio-api/src/system/types.ts | Added uid field to AudioDeviceInfo, renamed allowBluetooth to allowBluetoothHFP, added setInputDevice to interface |
| packages/react-native-audio-api/src/system/AudioManager.ts | Implemented setInputDevice method, reordered imports |
| packages/react-native-audio-api/src/specs/NativeAudioAPIModule.web.ts | Added setInputDevice method to web spec |
| packages/react-native-audio-api/src/specs/NativeAudioAPIModule.ts | Added setInputDevice to native spec, added non-null assertion |
| packages/react-native-audio-api/src/index.ts | Exported hooks from package entry point |
| packages/react-native-audio-api/src/hooks/useSystemVolume.ts | Updated import to use AudioManager from api module |
| packages/react-native-audio-api/src/hooks/useAudioInput.ts | New hook for managing audio input device selection |
| packages/react-native-audio-api/src/hooks/index.ts | Created hooks barrel export file |
| packages/react-native-audio-api/src/events/types.ts | Extracted InterruptionType and RouteChangeReason as exported types |
| packages/react-native-audio-api/src/api.ts | Reorganized exports, removed useSystemVolume export |
| packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.mm | Implemented setInputDevice, added uid to device info, changed allowBluetooth to allowBluetoothHFP |
| packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.h | Added setInputDevice method declaration |
| packages/react-native-audio-api/ios/audioapi/ios/AudioAPIModule.mm | Exposed setInputDevice to React Native bridge |
| packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/system/notification/PlaybackNotificationReceiver.kt | Added blank lines for formatting consistency |
| packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt | Added setInputDevice stub (no-op pending duplex stream implementation) |
| packages/audiodocs/docs/system/audio-manager.mdx | Updated documentation for renamed Bluetooth option |
| packages/audiodocs/docs/react/select-input.mdx | Added documentation for new useAudioInput hook |
| packages/audiodocs/docs/react/category.json | Created React hooks documentation category |
| apps/fabric-example/ios/Podfile.lock | Updated hermes-engine hash |
| apps/common-app/src/examples/Record/Record.tsx | Added device selection UI, updated to use allowBluetoothHFP |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/react-native-audio-api/android/src/main/java/com/swmansion/audioapi/AudioAPIModule.kt
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
poneciak57
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍
Closes #734
Introduced changes
Checklist