File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,9 @@ export const VoiceProvider: FC<VoiceProviderProps> = ({
232232 if ( player . isPlaying ) {
233233 onInterruption . current ( message ) ;
234234 }
235+ const shouldFadeOut = message . type === 'user_interruption' ;
235236 player . clearQueue ( {
236- fadeOut : message . type === 'user_interruption' ,
237+ fadeOut : shouldFadeOut ,
237238 } ) ;
238239 }
239240
Original file line number Diff line number Diff line change @@ -171,8 +171,9 @@ export const useSoundPlayer = (props: {
171171 } : {
172172 fadeOut ?: boolean ;
173173 } = { } ) => {
174- if ( fadeOut ) workletNode . current ?. port . postMessage ( { type : 'fade' } ) ;
175- workletNode . current ?. port . postMessage ( { type : 'clear' } ) ;
174+ workletNode . current ?. port . postMessage ( {
175+ type : fadeOut ? 'fade' : 'clear' ,
176+ } ) ;
176177
177178 isProcessing . current = false ;
178179 setIsPlaying ( false ) ;
You can’t perform that action at this time.
0 commit comments