File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
expo-package/src/optionalDependencies
src/components/MessageInput/hooks Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,6 @@ class ExpoAudioRecordingAdapter {
235235 clearInterval ( this . recordingStateInterval ) ;
236236 await this . recording . stop ( ) ;
237237 this . uri = this . recording . uri ;
238- this . recording . release ( ) ;
239238 } ;
240239
241240 getURI = ( ) => this . uri ;
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ class ExpoAudioSoundAdapter {
6969 initialStatus ,
7070 onPlaybackStatusUpdate : ( playbackStatus : PlaybackStatus ) => void ,
7171 ) {
72- this . player = expoCreateSoundPlayer ?.( source , initialStatus . progressUpdateIntervalMillis ) ;
72+ this . player = expoCreateSoundPlayer ?.( source , {
73+ updateInterval : initialStatus . progressUpdateIntervalMillis ,
74+ } ) ;
7375 this . onPlaybackStatusUpdate = ( playbackStatus : ExpoAudioPlaybackStatus ) => {
7476 onPlaybackStatusUpdate ( expoAudioToExpoAvStatusAdapter ( playbackStatus ) ) ;
7577 if ( playbackStatus . didJustFinish ) {
Original file line number Diff line number Diff line change @@ -158,8 +158,9 @@ export const useAudioController = () => {
158158 }
159159 // For Expo CLI
160160 if ( soundRef . current ?. stopAsync && soundRef . current ?. unloadAsync ) {
161- await soundRef . current . stopAsync ( ) ;
161+ await soundRef . current ? .stopAsync ( ) ;
162162 await soundRef . current ?. unloadAsync ( ) ;
163+ soundRef . current = null ;
163164 }
164165 } ;
165166
@@ -247,9 +248,7 @@ export const useAudioController = () => {
247248 if ( recordingStatus === 'recording' ) {
248249 await stopVoiceRecording ( ) ;
249250 }
250- if ( ! paused ) {
251- await stopVoicePlayer ( ) ;
252- }
251+ await stopVoicePlayer ( ) ;
253252 resetState ( ) ;
254253 NativeHandlers . triggerHaptic ( 'impactMedium' ) ;
255254 } ;
@@ -320,7 +319,9 @@ export const useAudioController = () => {
320319 recordingDuration,
321320 recordingStatus,
322321 setMicLocked,
322+ startVoicePlayer,
323323 startVoiceRecording,
324+ stopVoicePlayer,
324325 stopVoiceRecording,
325326 uploadVoiceRecording,
326327 waveformData,
You can’t perform that action at this time.
0 commit comments