()
| 311 | } |
| 312 | |
| 313 | pause (): void { |
| 314 | if (!this._isPlaying) { |
| 315 | return; |
| 316 | } |
| 317 | |
| 318 | this.pausedAt = this.audioContext.currentTime - this.startedAt; |
| 319 | this._isPlaying = false; |
| 320 | this._isPaused = true; |
| 321 | |
| 322 | // This will call onended, which we suppress, and then we clean up. |
| 323 | this.cleanup(); |
| 324 | } |
| 325 | |
| 326 | stop (): void { |
| 327 | if (!this.sourceNode && !this._isPlaying) { |
no test coverage detected