Skip to content

Commit

Permalink
Fix time returning nothing when sound not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Nov 4, 2024
1 parent f37cd14 commit 09f8011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/src/chart/ChartManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,7 @@ export class ChartManager {
}

playPause() {
this.setNoteIndex()
if (this.chartAudio.isPlaying()) this.chartAudio.pause()
else this.chartAudio.play()
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/chart/audio/ChartAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ export class ChartAudio {
seek(): number
seek(playbackTime: number): void
seek(playbackTime?: number) {
if (this._destroyed) return
if (!this._source) return
if (this._destroyed) return 0
if (!this._source) return 0
if (playbackTime === undefined) {
if (!this._isPlaying) return this._playbackTime
return (
Expand Down

0 comments on commit 09f8011

Please sign in to comment.