Skip to content

Commit

Permalink
fix songs audio not starting on html5
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed May 21, 2024
1 parent 82385ee commit f87a254
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions source/funkin/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,20 @@ class PlayState extends MusicBeatState

ModdingUtil.addCall('startSong');

if (!paused) {
Conductor.play();
Conductor.sync();
}

Conductor.setPitch(Conductor.songPitch);
Conductor.volume = 1;
Conductor.setPitch(Conductor.songPitch);
Conductor.sync();
Conductor.play();

#if html5
// Dont know, dont ask
FlxG.signals.preUpdate.addOnce(() -> {
Conductor.pause();
Conductor.setPitch(Conductor.songPitch);
Conductor.sync();
Conductor.play();
});
#end

// Song duration in a float, useful for the time left feature
songLength = Conductor.inst.length;
Expand Down

0 comments on commit f87a254

Please sign in to comment.