@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
32 lines (31 loc) • 1.16 kB
TypeScript
/**
* Replicate Music Handler (MusicGen default)
*
* Routes music generation through Replicate's universal prediction
* lifecycle. Default model is Meta's MusicGen; alternatives include
* Riffusion, AudioGen, and AudioLDM via `options.model`.
*
* @module music/providers/ReplicateMusic
* @see https://replicate.com/meta/musicgen
*/
import type { MusicAudioFormat, MusicHandler, MusicOptions, MusicResult } from "../../types/index.js";
export declare class ReplicateMusic implements MusicHandler {
readonly maxDurationSeconds = 30;
readonly supportedFormats: readonly MusicAudioFormat[];
readonly supportedGenres: readonly string[];
isConfigured(): boolean;
generate(options: MusicOptions): Promise<MusicResult>;
private buildPrompt;
private resolveBuffer;
/**
* Detect audio MIME subtype from magic bytes.
*
* - WAV : "RIFF" header (52 49 46 46)
* - MP3 : ID3 tag (49 44 33) or MPEG sync word 0xFF 0xEx
* - OGG : "OggS" capture pattern (4F 67 67 53)
* - M4A : "ftyp" box at offset 4
*
* Falls back to "mp3" when detection is inconclusive.
*/
private detectAudioType;
}