Skip to content

Commit

Permalink
Merge pull request #316 from AnLiBoBo/master
Browse files Browse the repository at this point in the history
scene与audio绑定,默认不设置ss和to的情况下,会自动设置从audio的0秒播放到scene的duration秒
  • Loading branch information
drawcall authored Jan 20, 2023
2 parents 8b8c8e1 + c3a5925 commit 629ff8d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/audio/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class FFAudio extends FFBase {
this.fadeOut = fadeOut;
}

setSs(ss) {
this.ss = ss;
}

setTo(to) {
this.to = to;
}

addInput(command) {
const { loop, ss, to, path } = this;

Expand Down
6 changes: 6 additions & 0 deletions lib/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ class FFCreator extends FFCon {
const duration = this.getPrevScenesDuration(index - 1);
audio.start = duration + audio.start;
}

if(!audio.hasSSTO()) {
audio.setSs("0:00.000")
audio.setTo(scene.duration)
}

});
audios = audios.concat(scene.audios);
});
Expand Down

0 comments on commit 629ff8d

Please sign in to comment.