Spaces:
Running
Running
Download app/api/split/route.ts from Reubencf/Score-Studio: direct link, hf CLI and curl.
- Browser
- Download file 544 Bytes
-
https://huggingface.co/spaces/Reubencf/Score-Studio/resolve/main/app/api/split/route.ts
- Command line
-
hf download hf://spaces/Reubencf/Score-Studio/app/api/split/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/Reubencf/Score-Studio/resolve/main/app/api/split/route.ts
544 Bytes
| import {audioJob} from '@/lib/studio-route'; | |
| import {ENGINE} from '@/lib/kiku'; | |
| import type {StemsResult} from '@/lib/types'; | |
| export const runtime='nodejs'; | |
| /** Separate a clip into vocals, drums, bass and everything else. */ | |
| export async function POST(req:Request){ | |
| return audioJob(req,{ | |
| endpoint:'/split',fixed:ENGINE,limits:{min:3,max:360}, | |
| build:()=>({args:audio=>[audio]}), | |
| shape:(data,file)=>({status:String(data[0]??''),vocals:file(data[1]),drums:file(data[2]), | |
| bass:file(data[3]),other:file(data[4])}) as StemsResult, | |
| }); | |
| } | |