Autoscoreaudiolib × video
This is the whole integration.
Your platform understands the footage — cuts, pacing, mood — far better than we ever could. What it can’t do is legally license commercial music inside an automated pipeline. That’s the whole reason audiolib exists: one API call, cleared music, done. It took us about this much code to plug it into this showcase.
Get a key at audiolib.ai, keep it server-side, and call the endpoint:
const res = await fetch("https://api.audiolib.ai/v1/audio", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AUDIOLIB_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ library: "audio.cinematic" }),
});
const { data } = await res.json();
// data.title, data.url, data.duration_secA track is rarely exactly as long as your video, so keep pulling and crossfading until it is. This is the actual function this showcase uses:
// Keep pulling tracks and crossfading them until they cover targetDurationSec.
// audiolib fills the duration — you own mixing, sync, and the final render.
async function planAudioBed(library, targetDurationSec, crossfadeSec = 2.5) {
const tracks = [];
let coveredSec = 0;
while (coveredSec < targetDurationSec) {
const track = await fetchTrack(library); // POST /v1/audio
tracks.push(track);
coveredSec += track.duration_sec - (tracks.length > 1 ? crossfadeSec : 0);
}
return tracks; // then: crossfade, trim to length, fade out. Time-fill only.
}audiolib supplies
- Cleared music, picked by mood
- Enough tracks to fill any duration
you own
- Mixing under your original audio
- Any sync to cuts, beats, or scenes, and the final render
We don’t do frame-sync, stems, or per-shot generation. Aligning pre-made tracks to pre-made footage is a false problem — we don’t attempt it, and you shouldn’t need us to.