mirror of
https://github.com/motion-canvas/motion-canvas.git
synced 2026-01-11 14:57:56 -05:00
feat: audio offset
This commit is contained in:
@@ -20,10 +20,12 @@ export function AudioTrack() {
|
||||
const samplesPerSeconds = audio.sample_rate / audio.samples_per_pixel;
|
||||
const step = Math.ceil(density / 256);
|
||||
const start = Math.floor(
|
||||
player.project.framesToSeconds(startFrame) * samplesPerSeconds,
|
||||
(player.project.framesToSeconds(startFrame) + player.audio.offset) *
|
||||
samplesPerSeconds,
|
||||
);
|
||||
const end = Math.floor(
|
||||
player.project.framesToSeconds(endFrame) * samplesPerSeconds,
|
||||
(player.project.framesToSeconds(endFrame) + player.audio.offset) *
|
||||
samplesPerSeconds,
|
||||
);
|
||||
|
||||
context.clearRect(0, 0, viewLength, 64);
|
||||
|
||||
@@ -155,7 +155,7 @@ export function Timeline() {
|
||||
<TimestampTrack />
|
||||
<SceneTrack />
|
||||
<LabelTrack />
|
||||
<AudioTrack />
|
||||
{player.audio && <AudioTrack />}
|
||||
</div>
|
||||
<div ref={playheadRef} className={styles.playheadPreview} />
|
||||
<Playhead />
|
||||
|
||||
Reference in New Issue
Block a user