Music Analysis & Tagging

Run structured music analysis on audio. Output has two layers: a hard-metrics layer (precise timestamps, always computed locally) providing BPM, key, beats/downbeats, segments, chorus, and the emotional highlight; and an optional semantic layer providing genre, mood, instruments, a natural-language description, and a descriptive tag cloud. Ideal for music catalog tagging, smart soundtracking, beat-synced editing, preview/highlight generation, and music search & recommendation.

  • Endpoint: POST /task/audio_music_analyze
  • Task Type: audio_music_analyze
  • Billing: By audio duration (per minute)

Processing Example

Output Visualization

What These Fields Are For

Below is the real analysis output of the sample track. Hit play and the timeline syncs with the music; every field is annotated with how it is used in production.

Tempo (BPM)

754/4

Use · Beat-synced editing, time-stretch matching, auto beat-align

Key

F# majorconfidence 74%

Use · Transpose/mix, accompaniment matching, key-based playlists

Duration

4:09

Use · Per-minute billing, scheduling estimates

Energy

35

Use · Playlist mood ordering, scene matching

Rhythm Timeline

Segments, chorus, highlight and downbeats share one timeline; the playhead moves in real time.

0:00 / 4:09
SegmentChorusHighlightDownbeat

Current segment

segment_00:000:00

Current beat

#0

Use · Section navigation, A/B looping, structured preview

Use · One-tap jump to chorus, auto preview clips

Use · Soundtrack cue-in point, cover-frame anchor

Use · Beat-cut editing: every downbeat is a natural transition point

· The API returns the most representative chorus segment (this track repeats the chorus several times).

· The highlight is the emotional peak and does not always align with the chorus — here it lands after the chorus.

Semantic Profile

Non-temporal, track-level attributes for search, recommendation and smart soundtrack selection. Returned when enable_semantic_tags is on.

Genres

c-pop
90%
ballad
85%
pop rock
75%

Moods

contemplative
90%
nostalgic
85%
longing
80%

Scenes

intimate
80%
reflective
75%

Use · Catalog search, smart soundtrack selection, ranking

Instruments

electric guitarelectronic drumsynth basssynth padpiano

Use · Similar-track matching, search by instrument

Descriptive Tags

深夜独处回忆氛围人声缥缈空间感强钢琴轻柔情感共鸣自然意象高保真音质

Use · Human-readable content tags for distribution

AI Description

The audio clip begins with a gentle, clean electric guitar arpeggio, setting a contemplative mood. Soon after, a soft electronic drumbeat and a warm, rounded synth bass join in, es…

Request Parameters

ParameterTypeRequiredDefaultDescription
file_idstringYes-File ID returned from upload, see File Upload
enable_semantic_tagsbooleanNofalseWhether to additionally output the semantic layer (genre/mood/instruments/description/tag cloud)
languagestringNozh-CNOutput language for the semantic layer. Affects only description / summary / descriptive_tags; classification tags such as genre and mood remain canonical English for search and de-duplication

Request Example

curl -X POST "https://cloud.ai-mcn.tv/task/audio_music_analyze" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "file_id": "537489015178246",
    "enable_semantic_tags": true,
    "language": "en-US"
  }'

Response Example

{
  "code": 0,
  "message": "success",
  "data": {
    "task_id": "537489015178247"
  }
}

The task is processed asynchronously. Poll the Task Status endpoint for results.

Result Retrieval

Once the task completes, retrieve the result via the task query endpoint:

{
  "code": 0,
  "message": "success",
  "data": {
    "task_id": "537489015178247",
    "status": "completed",
    "progress": 100,
    "output_result": {
      "duration": 235.4,
      "bpm": 120,
      "key": "C minor",
      "key_confidence": 0.78,
      "beats": [0.5, 1.0, 1.5],
      "downbeats": [0.5, 2.5, 4.5],
      "beat_positions": [1, 2, 3, 4],
      "segments": [
        { "start": 0.0, "end": 12.3, "label": "segment_0" }
      ],
      "chorus": { "start": 72.4, "end": 108.6 },
      "highlight": { "time": 178.4 },
      "semantic": {
        "description": "Indie pop instrumental led by piano and acoustic guitar, upbeat……",
        "description_raw": "Indie pop instrumental featuring piano and acoustic guitar……",
        "genres": [{ "name": "indie pop", "confidence": 0.95 }],
        "moods": [{ "name": "upbeat", "confidence": 0.9 }],
        "scenes": [{ "name": "coffee shop", "confidence": 0.6 }],
        "instruments": ["piano", "acoustic guitar", "bass", "drums"],
        "descriptive_tags": ["urban solitude", "cassette warmth", "late-night commute"],
        "voice_type": "instrumental",
        "energy": 60,
        "vocal_language": "instrumental",
        "tempo_descriptor": "medium",
        "summary": "An upbeat indie-pop piece driven by piano and guitar"
      }
    }
  }
}

Field Reference

FieldTypeDescription
durationnumberAudio duration (seconds)
bpmintegerTempo (beats per minute)
keystringMusical key, e.g. C minor
key_confidencenumberKey detection confidence
beatsnumber[]Timestamp (seconds) of each beat
downbeatsnumber[]Timestamp (seconds) of each bar's downbeat
beat_positionsinteger[]Position of each beat within its bar
segmentsarraySegment boundaries; each has start / end / label
chorusobject | nullMain chorus segment (start / end); null if undetectable
highlightobject | nullEmotional peak timestamp (time); usable as a preview start point
semanticobject | nullSemantic layer. null when enable_semantic_tags is off or the layer cannot be generated
semantic.descriptionstringLocalized natural-language description (follows language)
semantic.description_rawstringOriginal English description (for audit/reuse)
semantic.genres / moods / scenesarrayGenre / mood / scene classification tags; each has name (canonical English) and confidence
semantic.instrumentsstring[]Instrument list (canonical English)
semantic.descriptive_tagsstring[]Descriptive tag cloud (follows language, human-readable, e.g. "urban solitude", "cassette warmth")
semantic.voice_typestringVoice type: instrumental / male / female / mixed
semantic.energyintegerEnergy level (0–100)
semantic.vocal_languagestringThe language sung in the track (ISO 639-1; instrumental for instrumentals). Independent of the language request parameter
semantic.tempo_descriptorstringTempo descriptor: slow / medium / fast, etc.
semantic.summarystringOne-sentence summary (follows language)

Billing

  • Billed by audio duration in minutes, rounded up to the nearest minute
  • No charge for failed tasks; any deducted fees are automatically refunded
  • Enabling the semantic layer (enable_semantic_tags=true) incurs no extra charge; billing is still by audio duration. If the semantic layer cannot be generated, the hard-metrics layer is still returned, semantic is null, and the task is billed as successful
  • For detailed billing rules, see Billing

Limitations

  • Input supports audio files only (mp3, wav, m4a, aac, flac, ogg, etc.).
  • The hard-metrics layer (BPM/key/beats/segments/chorus/highlight) is always returned; the semantic layer requires enable_semantic_tags=true and is not output by default.
  • The semantic layer is best-effort: when it cannot be generated, semantic is null, which does not affect the hard-metrics layer or task success.
  • language must be a supported value; it only affects description / summary / descriptive_tags, while classification tags such as genre and mood remain canonical English.

Error Codes

Error CodeHTTP StatusDescriptionResolution
6013400Missing file_idPass the file_id field
6001400Unsupported file typeUpload a supported audio file
6016400Invalid task parameters (e.g. unsupported language)Use a supported language value
6017400Media probe failedEnsure the file is a valid, non-corrupt audio
6004404File not foundVerify the file_id
6502401Authentication failedCheck the Authorization header
6202402Insufficient balanceRecharge in the Dashboard