Fix issues with audio playback

This commit is contained in:
JannisX11 2021-01-24 22:35:22 +01:00
parent 3fd1ae7b8e
commit dd64a9755b
2 changed files with 8 additions and 6 deletions

View File

@ -1007,8 +1007,8 @@ class EffectAnimator extends GeneralAnimator {
keyframe.animator = this;
return this;
}
displayFrame() {
if (!this.muted.sound) {
displayFrame(in_loop) {
if (in_loop && !this.muted.sound) {
this.sound.forEach(kf => {
var diff = kf.time - Timeline.time;
if (diff >= 0 && diff < (1/60) * (Timeline.playback_speed/100)) {
@ -1355,7 +1355,7 @@ const Animator = {
object.scale.set(scale, scale, scale)
})
},
preview() {
preview(in_loop) {
// Bones
Animator.showDefaultPose(true);
Group.all.forEach(group => {
@ -1373,7 +1373,7 @@ const Animator = {
Animator.animations.forEach(animation => {
if (animation.playing) {
if (animation.animators.effects) {
animation.animators.effects.displayFrame();
animation.animators.effects.displayFrame(in_loop);
}
}
})

View File

@ -449,7 +449,9 @@ const Timeline = {
start() {
if (!Animation.selected) return;
Animation.selected.getMaxLength()
Timeline.pause()
if (Timeline.playing) {
Timeline.pause()
}
Timeline.playing = true
BarItems.play_animation.setIcon('pause')
Timeline.last_frame_timecode = Date.now();
@ -467,7 +469,7 @@ const Timeline = {
Timeline.loop()
},
loop() {
Animator.preview()
Animator.preview(true);
if (Animation.selected && Timeline.time < (Animation.selected.length||1e3)) {
var new_time;