Segment audio
segmentDetect song sections, tempo, bars, and structure from a mixed audio file. Returns section labels, BPM, key, time signature, and bar grid in one analysis run.
Instructions
Find song sections, tempo and bars (about half a minute).
Use for song structure. Send the mix: no stems needed, and it counts as one run.
metadata.analysis is the analysis (format 5; every time in seconds): bpm,
time_signature, key and camelot (null when no key was found), structure ("dance"
or "song" section names), bar1 (the first downbeat), lead_in (the time before bar 1,
or null), sections (label, start, end, start_bar, bars, fills: drum fill times) and a
tempo map. Beats and bars are not listed one by one: grid describes them -- where each
constant-tempo piece starts, its BPM, and its bar and beat. Every beat time is
start + k * 60 / bpm, and most tracks have one piece. The analysis_id it returns adds
audio_features, tag_audio, get_lyrics or generate_samples to this analysis without another
run. For tempo and key alone, analyze is quicker.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>"
},
"name": "segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edm | No | true: dance section names (INTRO, UP, CHORUS, DOWN, OUTRO); false: song section names (INTRO, VERSE, UP, CHORUS, OUTRO). Default: from the genre, else from the audio. | |
| genre | No | Genre hint for the section names, e.g. 'Tech House', 'Pop' or 'Drum N Bass' (a name Audial does not know returns the list). | |
| features | No | Optional, kept for older integrations: also compute these in the same call (mode, energy, loudness, danceability, tatum, tags, lyrics). The call then waits for them, minutes for tags and lyrics. Simpler: audio_features, tag_audio or get_lyrics afterwards with the analysis_id. | |
| file_path | Yes | Full path to a local audio file (.wav, .mp3, .aif, .aiff, .flac, .m4a, .ogg, .aac). ~ is expanded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tool | Yes | ||
| files | Yes | ||
| summary | Yes | ||
| metadata | Yes | ||
| output_dir | Yes | ||
| execution_id | Yes |