1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/sonilo-video-to-audio";
const data = {
"video_url": "https://segmind-resources.s3.amazonaws.com/input/sonilo-video-to-audio-src.mp4",
"sound_type": "music_and_sfx",
"music_prompt": "cinematic emotional orchestral score, warm swelling strings, hopeful and majestic, ocean adventure theme",
"sfx_prompt": "ocean waves crashing on rocks, sea spray, distant seagulls, coastal wind"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Public HTTP(S) URL of the source MP4 or MOV. Use a finished cut so audio tracks the edit.
Selects music, sfx, or combined output. Pick music_and_sfx for a full soundtrack plus effects.
Optional text steering score mood, genre, and instruments. Describe the scene for music or music_and_sfx.
Optional text guiding sound effects and ambience. Describe on-screen events for sfx or music_and_sfx.
Keeps source speech in music modes. Enable for narration, interviews, or voice-over clips.
Lowers music under detected speech in music modes. Keep true to keep dialogue clear.
Audio container; unsupported for music_and_sfx. music: m4a/wav; sfx: wav, mp3, aac or flac.
Optional timed music prompts for music mode. Segment starts must be at least 5 seconds apart.
Optional contiguous timed SFX prompts for sfx or music_and_sfx. First segment must start at 0.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Sonilo Video to Audio turns a video into a finished soundtrack. Instead of writing a text prompt and hoping the result fits, you pass a video URL and Sonilo reads the footage itself — runtime, pacing, motion, scene changes, transitions, and voice-over space — then generates audio that tracks the edit. A single sound_type switch chooses music, sfx, or music_and_sfx (a combined score plus synced sound effects). Generated audio matches the exact length of your clip and lands on a natural ending rather than an abrupt cut or loop, so it drops straight onto the timeline.
Sonilo is positioned as a professionally licensed, video-native audio model, making it a strong fit for creators and developers who need commercially usable music and sound design without searching stock libraries or manually syncing tracks.
music_and_sfx soundtrack.music_segments, sfx_segments) for timed prompts across sections.preserve_speech and ducking so narration stays clear in music modes.Score 30-second product ads that lift on the reveal, generate podcast intros, outros, and sponsor beds, follow interval energy on workout and fitness reels, and add cinematic music to drone and wedding footage. In testing, a silent cinematic ocean clip returned a clean, well-leveled stereo soundtrack that layered orchestral music under synced wave and seagull effects — exactly matching the clip length. The music_and_sfx mode is ideal for AI-generated video that otherwise arrives with no usable audio.
Start with a finished or near-final cut so timing is accurate. Leave prompts empty to let the video lead, or add a short music_prompt (mood, genre, instruments) and sfx_prompt (on-screen events) to steer style. For dialogue, keep ducking on and enable preserve_speech. Output is production-ready stereo audio delivered as a separate track you can balance in your editor.
Do I need a text prompt? No. Prompts are optional; the video is the primary input. Add music_prompt or sfx_prompt only when you want specific direction.
Does the audio match my video length? Yes. The soundtrack is generated to your clip's exact duration with a natural ending.
Can it make music and sound effects together? Yes — set sound_type to music_and_sfx for a combined soundtrack.
Will it keep my narration or dialogue? In music modes, enable preserve_speech and keep ducking on so speech stays audible under the music.
Does it generate video too? No. Sonilo produces audio only; it does not create or edit footage.
What input format should I use? Provide a public MP4 or MOV URL; a locked edit gives the best timing.