Skip to content

Commit 3376d32

Browse files
committed
fix: route audio time stretch through infrastructure
1 parent 57faf4a commit 3376d32

5 files changed

Lines changed: 18 additions & 2 deletions

File tree

scripts/check-legacy-lib-imports.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const ALLOWED_FACADE_FILES = new Set([
1818
'src/infrastructure/gpu/transitions.ts',
1919
'src/infrastructure/gpu/masks.ts',
2020
'src/infrastructure/gpu/scopes.ts',
21+
'src/infrastructure/audio/time-stretch.ts',
2122
'src/infrastructure/analysis/index.ts',
2223
]);
2324

src/features/composition-runtime/worklets/soundtouch-preview-processor.worklet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TimeStretchFilter, TimeStretchProcessor } from '@/lib/audio/time-stretch'
1+
import { TimeStretchFilter, TimeStretchProcessor } from '@/infrastructure/audio/time-stretch'
22
import {
33
SOUND_TOUCH_PREVIEW_PROCESSOR_NAME,
44
type SoundTouchPreviewProcessorMessage,

src/features/export/utils/canvas-audio.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ async function applySpeedAndPitch(
14481448
})
14491449

14501450
try {
1451-
const timeStretch = await import('@/lib/audio/time-stretch')
1451+
const timeStretch = await import('@/infrastructure/audio/time-stretch')
14521452
const st = new timeStretch.TimeStretchProcessor()
14531453

14541454
st.tempo = speed

src/features/timeline/hooks/use-waveform-prefetch.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ import { useWaveformPrefetch } from './use-waveform-prefetch'
1010
import { _resetPreviewWorkBudgetForTest } from './preview-work-budget'
1111
import { waveformCache } from '../services/waveform-cache'
1212
import { useItemsStore } from '../stores/items-store'
13+
import { useRippleEditPreviewStore } from '../stores/ripple-edit-preview-store'
14+
import { useRollingEditPreviewStore } from '../stores/rolling-edit-preview-store'
15+
import { useSlideEditPreviewStore } from '../stores/slide-edit-preview-store'
16+
import { useSlipEditPreviewStore } from '../stores/slip-edit-preview-store'
1317
import { useTimelineSettingsStore } from '../stores/timeline-settings-store'
1418
import { useTimelineViewportStore } from '../stores/timeline-viewport-store'
19+
import { useTrackPushPreviewStore } from '../stores/track-push-preview-store'
1520
import { _resetZoomStoreForTest } from '../stores/zoom-store'
1621

1722
function makeVideoItem(id: string, from: number, duration: number): VideoItem {
@@ -95,6 +100,11 @@ describe('waveform prefetch filtering', () => {
95100
})
96101
_resetZoomStoreForTest()
97102
useSelectionStore.getState().setDragState(null)
103+
useRollingEditPreviewStore.getState().clearPreview()
104+
useRippleEditPreviewStore.getState().clearPreview()
105+
useSlipEditPreviewStore.getState().clearPreview()
106+
useSlideEditPreviewStore.getState().clearPreview()
107+
useTrackPushPreviewStore.getState().clearPreview()
98108
useItemsStore.getState().setItems([])
99109
useItemsStore.getState().setTracks([])
100110
useTimelineViewportStore.getState().setViewport({
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Audio time-stretch facade.
3+
* Consumers should import audio processing utilities from here instead of @/lib/audio.
4+
*/
5+
export { TimeStretchFilter, TimeStretchProcessor } from '@/lib/audio/time-stretch'

0 commit comments

Comments
 (0)