Merge pull request #161 from storytold/feature/audio-timeline-fix

Feature/audio timeline fix
This commit is contained in:
ArEnSc authored and GitHub committed 2024-04-15 21:21:49 -04:00
commit 0fc2f9eaeb
2 files changed
+37 -15

No files matched your search

+29 -12
View File
@@ -378,7 +378,7 @@ class Editor {
console.log(result);
}
public async testTestTimelineEvents() {}
public async testTestTimelineEvents() { }
public async loadScene(scene_media_token: string) {
this.dispatchAppUiState({
@@ -854,10 +854,10 @@ class Editor {
audioSegment,
"-filter_complex",
"[1:a]adelay=" +
startTime * 1000 +
"|" +
startTime * 1000 +
"[a1];[0:a][a1]amix=inputs=2[a]",
startTime * 1000 +
"|" +
startTime * 1000 +
"[a1];[0:a][a1]amix=inputs=2[a]",
"-map",
"[a]",
`${itteration}final_tmp.wav`,
@@ -1107,6 +1107,7 @@ class Editor {
this.frame_buffer = [];
this.render_timer = 0;
this.activeScene.renderMode(this.rendering);
this.timeline.scrubber_frame_position = 0;
if (this.activeScene.hot_items) {
this.activeScene.hot_items.forEach((element) => {
element.visible = false;
@@ -1117,15 +1118,31 @@ class Editor {
startPlayback() {
this.updateLoad(25, "Starting Processing");
this.timeline.is_playing = true;
this.timeline.scrubber_frame_position = 0;
if (!this.camera_person_mode) {
if (!this.rendering && this.timeline.is_playing) {
this.timeline.is_playing = false;
this.timeline.scrubber_frame_position = 0;
this.timeline.current_time = 0;
this.timeline.stepFrame(0);
this.timeline.resetScene();
this.switchCameraView();
if (this.activeScene.hot_items) {
this.activeScene.hot_items.forEach((element) => {
element.visible = true;
});
}
}
if (this.activeScene.hot_items) {
this.activeScene.hot_items.forEach((element) => {
element.visible = false;
});
else {
this.timeline.is_playing = true;
this.timeline.scrubber_frame_position = 0;
if (!this.camera_person_mode) {
this.switchCameraView();
}
if (this.activeScene.hot_items) {
this.activeScene.hot_items.forEach((element) => {
element.visible = false;
});
}
}
}
+8 -3
View File
@@ -432,7 +432,7 @@ export class TimeLine {
this.is_playing = true;
}
private async resetScene() {
public async resetScene() {
for (const element of this.timeline_items) {
if (element.type === ClipType.TRANSFORM) {
const object = this.scene.get_object_by_uuid(element.object_uuid);
@@ -453,6 +453,9 @@ export class TimeLine {
element.type === ClipType.AUDIO &&
element.group === ClipGroup.CHARACTER
) {
this.lipSync_engine.clips[
element.object_uuid + element.media_id
].stop();
this.lipSync_engine.clips[
element.object_uuid + element.media_id
].reset();
@@ -511,7 +514,8 @@ export class TimeLine {
}
} else if (
element.type === ClipType.AUDIO &&
element.group !== ClipGroup.CHARACTER
element.group !== ClipGroup.CHARACTER &&
this.is_playing
) {
if (this.scrubber_frame_position + 1 >= element.length) {
this.audio_engine.stopClip(element.media_id);
@@ -520,7 +524,8 @@ export class TimeLine {
}
} else if (
element.type === ClipType.AUDIO &&
element.group === ClipGroup.CHARACTER
element.group === ClipGroup.CHARACTER &&
this.is_playing
) {
// we will remove this when we know which group it will come from character + audio === lip sync audio.
if (this.scrubber_frame_position + 1 >= element.length) {