mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
typescript: fix any types
This commit is contained in:
@@ -16,6 +16,8 @@ import { useMediaStore } from "@/stores/media-store";
|
|||||||
import { useProjectStore } from "@/stores/project-store";
|
import { useProjectStore } from "@/stores/project-store";
|
||||||
import { DEFAULT_FPS } from "@/stores/project-store";
|
import { DEFAULT_FPS } from "@/stores/project-store";
|
||||||
import { ExportOptions, ExportResult } from "@/types/export";
|
import { ExportOptions, ExportResult } from "@/types/export";
|
||||||
|
import { TimelineTrack } from "@/types/timeline";
|
||||||
|
import { MediaFile } from "@/types/media";
|
||||||
|
|
||||||
export const DEFAULT_EXPORT_OPTIONS: ExportOptions = {
|
export const DEFAULT_EXPORT_OPTIONS: ExportOptions = {
|
||||||
format: "mp4",
|
format: "mp4",
|
||||||
@@ -40,8 +42,8 @@ interface AudioElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createTimelineAudioBuffer(
|
async function createTimelineAudioBuffer(
|
||||||
tracks: any[],
|
tracks: TimelineTrack[],
|
||||||
mediaFiles: any[],
|
mediaFiles: MediaFile[],
|
||||||
duration: number,
|
duration: number,
|
||||||
sampleRate: number = 44100
|
sampleRate: number = 44100
|
||||||
): Promise<AudioBuffer | null> {
|
): Promise<AudioBuffer | null> {
|
||||||
@@ -51,7 +53,7 @@ async function createTimelineAudioBuffer(
|
|||||||
|
|
||||||
// Collect all audio elements from timeline
|
// Collect all audio elements from timeline
|
||||||
const audioElements: AudioElement[] = [];
|
const audioElements: AudioElement[] = [];
|
||||||
const mediaMap = new Map(mediaFiles.map((m) => [m.id, m]));
|
const mediaMap = new Map<string, MediaFile>(mediaFiles.map((m) => [m.id, m]));
|
||||||
|
|
||||||
for (const track of tracks) {
|
for (const track of tracks) {
|
||||||
if (track.muted) continue;
|
if (track.muted) continue;
|
||||||
@@ -59,7 +61,7 @@ async function createTimelineAudioBuffer(
|
|||||||
for (const element of track.elements) {
|
for (const element of track.elements) {
|
||||||
if (element.type !== "media") continue;
|
if (element.type !== "media") continue;
|
||||||
|
|
||||||
const mediaItem = mediaMap.get(element.mediaId);
|
const mediaItem = element.type === "media" ? mediaMap.get(element.mediaId) : null;
|
||||||
if (!mediaItem || mediaItem.type !== "audio") continue;
|
if (!mediaItem || mediaItem.type !== "audio") continue;
|
||||||
|
|
||||||
const visibleDuration =
|
const visibleDuration =
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
subject: export is out - maze from opencut
|
||||||
|
|
||||||
|
wassup, the thing you've been waiting for is finally out - the export button
|
||||||
|
|
||||||
|
opencut.app
|
||||||
|
|
||||||
|
give it a try, or don't, up to you ❤️
|
||||||
|
|
||||||
|
have an amazing day :)
|
||||||
|
|
||||||
|
[unsubscribe]({{unsubscribe_url}})
|
||||||
Reference in New Issue
Block a user