Skip to content
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

[docs][audio] update example to help users avoid disabling speaker #19621

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/pages/versions/unversioned/sdk/audio.mdx
Expand Up @@ -116,8 +116,11 @@ export default function App() {
async function stopRecording() {
console.log('Stopping recording..');
setRecording(undefined);
/* @info */ await recording.stopAndUnloadAsync();
const uri = recording.getURI(); /* @end */
/* @info */ await recording.stopAndUnloadAsync(); /* @end */
/* @info iOS may reroute audio playback to the phone earpiece when recording is allowed, so disable once finished. */ await Audio.setAudioModeAsync({
allowsRecordingIOS: false,
}); /* @end */
/* @info */ const uri = recording.getURI(); /* @end */
console.log('Recording stopped and stored at', uri);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/expo-av/build/Audio.types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-av/build/Audio.types.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-av/src/Audio.types.ts
Expand Up @@ -2,7 +2,7 @@
export type AudioMode = {
/**
* A boolean selecting if recording is enabled on iOS.
* > When this flag is set to `true`, playback may be routed to the phone receiver instead of to the speaker.
* > When this flag is set to `true`, playback may be routed to the phone earpiece instead of to the speaker. Set it back to 'false' after stopping recording to reenable playback through the speaker.
keith-kurak marked this conversation as resolved.
Show resolved Hide resolved
* @default false
*/
allowsRecordingIOS: boolean;
Expand Down