Skip to content

Commit 0e00b19

Browse files
committed
added function to detect pauses in audio track
1 parent 25ff41c commit 0e00b19

File tree

4 files changed

+324
-197
lines changed

4 files changed

+324
-197
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ dist-ssr
2525

2626
**/*.mjs
2727
**/*.env
28+
29+
# TODO remove again just for testing
30+
public/tutorial.mp4

playground/main.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ const image = await composition.add(
3232
})
3333
);
3434

35+
const track = composition.findTracks(core.VideoTrack).at(0);
36+
37+
console.log(await track?.detectSilences());
38+
39+
const track2 = new core.VideoTrack();
40+
41+
const video_tutorial = await new core.VideoClip(await core.VideoSource
42+
.from('/tutorial.mp4'), {
43+
volume: 0.1,
44+
anchor: 0.5,
45+
position: 'center',
46+
height: '100%',
47+
});
48+
49+
await track2.add(video_tutorial);
50+
51+
console.log("video_tutorial", await track2.detectSilences());
52+
3553
image.animate()
3654
.rotation(-16).to(14, 5).to(-7, 10).to(24, 7).to(-3, 9).to(19, 7).to(-14, 12).to(5, 9).to(-30, 13)
3755
.translateX(1700, 0, 'easeOut').to(-1400, 40)

0 commit comments

Comments
 (0)