File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,18 +65,25 @@ var WebAudioSound = new Class({
6565 this . source . buffer = this . audioBuffer ;
6666 this . source . connect ( this . muteNode ) ;
6767 this . applyConfig ( ) ;
68- this . source . start ( ) ;
68+ this . source . start ( 0 , 0 , this . currentConfig . duration ) ;
6969 this . startTime = this . manager . context . currentTime ;
7070 this . pausedTime = 0 ;
7171 return this ;
7272 } ,
7373 pause : function ( ) {
7474 BaseSound . prototype . pause . call ( this ) ;
75+ this . source . stop ( ) ;
76+ this . source = null ;
7577 this . pausedTime = this . manager . context . currentTime - this . startTime ;
7678 return this ;
7779 } ,
7880 resume : function ( ) {
7981 BaseSound . prototype . resume . call ( this ) ;
82+ this . source = this . manager . context . createBufferSource ( ) ;
83+ this . source . buffer = this . audioBuffer ;
84+ this . source . connect ( this . muteNode ) ;
85+ this . applyConfig ( ) ;
86+ this . source . start ( 0 , this . pausedTime , this . currentConfig . duration - this . pausedTime ) ;
8087 this . startTime = this . manager . context . currentTime - this . pausedTime ;
8188 this . pausedTime = 0 ;
8289 return this ;
You can’t perform that action at this time.
0 commit comments