File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -335,6 +335,9 @@ export class AudioEngine implements IAudioEngine {
335335
336336 this . onAudioUnlockedObservable . clear ( ) ;
337337 this . onAudioLockedObservable . clear ( ) ;
338+
339+ this . _audioContext ?. close ( ) ;
340+ this . _audioContext = null ;
338341 }
339342
340343 /**
Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ export class MockedAudioObjects {
100100 return {
101101 currentTime : 0 ,
102102 state : "running" ,
103+ close : jest . fn ( ) . mockName ( "close" ) . mockImplementation ( ( ) => {
104+ this . audioContext . state = "closed" ;
105+ return Promise . resolve ( ) ;
106+ } ) ,
103107 createBufferSource : jest . fn ( ) . mockName ( "createBufferSource" ) . mockImplementation ( ( ) => {
104108 const bufferSource = new AudioBufferSourceNodeMock ;
105109 this . _audioBufferSources . push ( bufferSource ) ;
You can’t perform that action at this time.
0 commit comments