PageSourceSearch

https://cai.audio/assets/audioFileUploader-CKMpGHaq.js

js cai.audio collected 2026-10-05 22:37:37 UTC 1,391 bytes, 1 lines download raw bytes

1import{e as o,b as i,a as l,c as f,w as g}from"./index-B2t2GiYn.js";import"./fundamental-detector-eOE6r6IZ.js";import"./song-scheduler-B44bR_LS.js";import"./instrument-player-NxMImQOz.js";import"./audio-file-player-CaPcbHD5.js";async function S(s,e,r){try{if(!r.fileName||r.sampleRate==null||r.samples==null)return o("Missing required audio file metadata for upload",{audioFileId:s,metadata:r}),!1;if(!e||e.length===0||!e[0]||e[0].length===0)return o("Invalid audio data for upload",{audioFileId:s}),!1;const p=i(e),n=new FormData;if(n.append("file",p,r.fileName),n.append("audio_file_id",s.toString()),n.append("file_name",r.fileName),n.append("sample_rate",r.sampleRate.toString()),n.append("samples",r.samples.toString()),r.originalKey){const m=`${r.originalKey.chroma}_${r.originalKey.quality}`;n.append("original_key",m)}r.originalBpm!==void 0&&r.originalBpm!==null&&n.append("original_bpm",r.originalBpm.toString()),r.instrument&&n.append("instrument",r.instrument);const t=await l.post(`${f.caiServerFastAPI}/api/v0/user-data/audio/upload`,n,{headers:{"Content-Type":"multipart/form-data"}});return t.status===200||t.status===201?!0:(g("Audio file upload returned non-success status",{audioFileId:s,status:t.status}),!1)}catch(p){return o("Error uploading audio file to backend",{audioFileId:s,error:p instanceof Error?p.message:String(p)}),!1}}export{S as uploadAudioFileToBackend};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.