Mika Scraper / VocalRemover
Class: VocalRemover
Defined in: src/_other-scraper/vocal-remove.ts:29
The VocalRemover
class manages interactions with the AI Vocal Remover API. It includes methods to upload audio files and process them to separate vocals from instruments.
Constructors
Constructor
new VocalRemover():
VocalRemover
Returns
Returns a new instance of VocalRemover
.
Methods
upload()
upload(
filePath
):Promise
<UploadResponse
>
Defined in: src/_other-scraper/vocal-remove.ts:42
Uploads an audio file to the AI Vocal Remover service.
Parameters
filePath
Type: string
Description: The local path to the audio file that needs to be uploaded.
Returns
Type: Promise
<UploadResponse
>
Description: A promise that resolves to an UploadResponse
, which contains the file_name
and key
for the uploaded file.
Throws
Throws an Error if the upload operation fails.
Example
const vr = new VocalRemover();
const uploaded = await vr.upload('./song.mp3');
process()
process(
upload
):Promise
<ProcessResponse
>
Defined in: src/_other-scraper/vocal-remove.ts:66
Processes the uploaded audio file to separate vocals from instrumental tracks.
Parameters
upload
Type: UploadResponse
Description: An object containing the file_name
and key
of the uploaded audio file.
Returns
Type: Promise
<ProcessResponse
>
Description: A promise that resolves to a ProcessResponse
, which includes URLs for both the vocal and instrumental tracks.
Throws
Throws an Error if the processing operation fails.
Example
// Upload step: await vr.upload() returns `uploaded`
const result = await vr.process(uploaded);
run()
run(
filePath
):Promise
<ProcessResponse
>
Defined in: src/_other-scraper/vocal-remove.ts:96
Uploads and processes the audio file in a single step.
Parameters
filePath
Type: string
Description: The local path to the audio file to upload and process.
Returns
Type: Promise
<ProcessResponse
>
Description: A promise that resolves to a ProcessResponse
, which includes URLs for both vocal and instrumental tracks.
Example
const result = await vr.run('./song.mp3');