File size: 544 Bytes
a63c2c0
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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,
 });
}