clapper / src /services /io /parseFilesIntoSegments.ts
jbilcke-hf's picture
jbilcke-hf HF staff
add linter and prettifier
c1f12bf
raw
history blame
No virus
443 Bytes
import { ClapSegment } from '@aitube/clap'
import { parseFileIntoSegments } from './parseFileIntoSegments'
export async function parseFilesIntoSegments({
files,
}: {
/**
* The files to import
*/
files: File[]
}): Promise<ClapSegment[]> {
return (
await Promise.all(
files.map((file) =>
parseFileIntoSegments({
file,
})
)
)
).reduce((acc, segments) => [...acc, ...segments], [])
}