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

Expo av plays audio only from earpiece instead of speaker #19298

Closed
ShumGG opened this issue Sep 29, 2022 · 6 comments
Closed

Expo av plays audio only from earpiece instead of speaker #19298

ShumGG opened this issue Sep 29, 2022 · 6 comments
Labels
invalid issue: question Issues on this repository are reserved for bug reports needs validation Issue needs to be validated

Comments

@ShumGG
Copy link

ShumGG commented Sep 29, 2022

Summary

Playing video or audio but the sound only comes out from earpiece and not from speaker in ios

What platform(s) does this occur on?

iOS

Environment

expo-env-info 1.0.5 environment info:
System:
OS: macOS 12.1
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.15.0 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.6.0 - /opt/homebrew/bin/npm
Watchman: 2022.09.19.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
npmPackages:
expo: ^45.0.0 => 45.0.8
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-web: 0.17.7 => 0.17.7
npmGlobalPackages:
eas-cli: 1.1.1
expo-cli: 6.0.5
Expo Workflow: managed

Minimal reproducible example

Audio.setAudioModeAsync({
        allowsRecordingIOS: true,
        staysActiveInBackground: false,
        playsInSilentModeIOS: true,
        shouldDuckAndroid: true,
        interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX,
        playThroughEarpieceAndroid: false,
        interruptionModeIOS: 1,
        interruptionModeAndroid: 1,
        IOSAudioQuality: 127,
    });
    
    
    have this config for the audio, but same
@ShumGG ShumGG added the needs validation Issue needs to be validated label Sep 29, 2022
@brentvatne brentvatne added the invalid issue: question Issues on this repository are reserved for bug reports label Sep 30, 2022
@expo-bot
Copy link
Collaborator

Hello! Our GitHub issues are reserved for bug reports.

If you have a question about Expo or related tools, please post on our forums at https://forums.expo.dev/ or join our Discord at https://chat.expo.dev/.

Resources

@kauan777
Copy link

@ShumGG conseguiu resolver esse erro man?

@ShumGG
Copy link
Author

ShumGG commented Oct 10, 2023

@ShumGG conseguiu resolver esse erro man?

Yes, was another code that crashed the app when I'm in background

@kauan777
Copy link

kauan777 commented Oct 10, 2023

i'm have same problem, any idea?

useEffect(() => { (async () => { Audio.requestPermissionsAsync().then(({ granted }) => { if (granted) { Audio.setAudioModeAsync({ allowsRecordingIOS: true, interruptionModeIOS: InterruptionModeIOS.DoNotMix, playsInSilentModeIOS: true, shouldDuckAndroid: true, interruptionModeAndroid: InterruptionModeAndroid.DoNotMix, playThroughEarpieceAndroid: false, }); } }); })(); }, []);

"expo-av": "~13.4.1",

@ShumGG
Copy link
Author

ShumGG commented Oct 11, 2023

i'm have same problem, any idea?

useEffect(() => { (async () => { Audio.requestPermissionsAsync().then(({ granted }) => { if (granted) { Audio.setAudioModeAsync({ allowsRecordingIOS: true, interruptionModeIOS: InterruptionModeIOS.DoNotMix, playsInSilentModeIOS: true, shouldDuckAndroid: true, interruptionModeAndroid: InterruptionModeAndroid.DoNotMix, playThroughEarpieceAndroid: false, }); } }); })(); }, []);

"expo-av": "~13.4.1",

guess you need to add staysActiveInBackground: true, and for ios in app.json "ios": { "supportsTablet": true, "bundleIdentifier": "com.yourcompany.yourappname", "buildNumber": "1.0.0", "infoPlist": { "UIBackgroundModes": [ "audio" ] } },

@hotlabs-technology
Copy link

Same problem here, any solution? I'm setting allowsRecordingIOS: false before the playback as suggested in some other post, but no solution so far

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid issue: question Issues on this repository are reserved for bug reports needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests

5 participants