Back to Library
Scrape Remove Vocal
js • 1/26/2026
9
const axios = require("axios");
async function uploadAudioBuffer(buffer) {
try {
const boundary = "----WebKitFormBoundary" + Math.random().toString(16).slice(2);
const multipartBody = Buffer.concat([
Buffer.from(`--${boundary}\r\n`),
Buffer.from(`Content-Disposition: form-data; name="fileName"; filename="audio.mp3"\r\n`),
Buffer.from(`Content-Type: audio/mpeg\r\n\r\n`),
Buffer.from(buffer),
Buffer.from(`\r\n--${boundary}--\r\n`)
]);
const res = await axios.post(
"https://aivocalremover.com/api/v2/FileUpload",
multipartBody,
{
headers: {
"Content-Type": `multipart/form-data; boundary=${boundary}`,
"Content-Length": multipartBody.length,
"User-Agent": "Mozilla/5.0",
"X-Requested-With": "XMLHttpRequest"
}
}
);
const { data } = res;
if (data?.error) throw new Error(data.message);
return {
key: data.key,
file_name: data.file_name
};
} catch (err) {
throw new Error("Upload error: " + err.message);
}
}
async function processAudio(file_name, key) {
const params = new URLSearchParams({
file_name,
action: "watermark_video",
key,
web: "web"
});
try {
const res = await axios.post(
"https://aivocalremover.com/api/v2/ProcessFile",
params.toString(),
{
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"User-Agent": "Mozilla/5.0",
"X-Requested-With": "XMLHttpRequest"
}
}
);
const { data } = res;
if (data?.error) throw new Error(data.message);
return {
vocal: data.vocal_path,
instrumental: data.instrumental_path
};
} catch (err) {
throw new Error("Process error: " + err.message);
}
}
module.exports = { uploadAudioBuffer, processAudio };