Open jordibruin opened 4 years ago
:beetle: Description I'm trying to play a sound through the earpiece speakers so that a user can only hear it when they put the phone up to their ear.
:beetle: What have you tried? It seems like this feature is only implemented for android, by using the playThroughEarpieceAndroid: true prop.
playThroughEarpieceAndroid: true
Is your issue with...
Are you using...
react-native run-android
Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?
:beetle: Please post your code:
Audio.setAudioModeAsync({ allowsRecordingIOS: false, interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX, playsInSilentModeIOS: true, shouldDuckAndroid: true, interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX, playThroughEarpieceAndroid: true, staysActiveInBackground: false }); } async _playRecording() { const { sound } = await Audio.Sound.create( source, { shouldPlay: true, isLooping: true }, this._updateScreenForSoundStatus ); this.sound = sound; this.setState({ playingStatus: "playing" }); }
:beetle: Description I'm trying to play a sound through the earpiece speakers so that a user can only hear it when they put the phone up to their ear.
:beetle: What have you tried? It seems like this feature is only implemented for android, by using the
playThroughEarpieceAndroid: true
prop.Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?
:beetle: Please post your code: