---
title: "Detect music and speech in an audio file"
method: POST
path: "/api/velma-2-music-detection-batch"
---

# Detect music and speech in an audio file

`POST /api/velma-2-music-detection-batch`

Accepts an audio file and returns frame-level music and speech
probabilities, an overall primary label, and percentage breakdowns of
content type across the clip.

## Response `200`

Detection completed successfully.

- MusicDetectionResponse
  - `filename` string, required — Name of the submitted audio file. Empty string if no filename was provided in the upload.
  - `duration_s` number, double, required — Total duration of the analysed audio in seconds.
  - `primary_label` 'music' | 'speech' | 'neither' | 'unknown', required — Overall classification of the clip: - `music` - music covers at least as much of the clip as speech, and more than zero. - `speech` - speech covers more of the clip than music, and more than zero. - `neither` - neither music nor speech reached the dominant threshold for any portion of the clip. - `unknown` - no frames could be produced from the audio.
  - `music_pct` number, double, required — Percentage of the clip classified as containing music.
  - `speech_pct` number, double, required — Percentage of the clip classified as containing speech.
  - `latency_ms` number, double, required — End-to-end inference time in milliseconds.
  - `frames` FrameResult[], required — Ordered list of per-frame classification results covering the full duration of the clip.
    - `start_time_ms` integer, required — Frame start time in milliseconds.
    - `end_time_ms` integer, required — Frame end time in milliseconds.
    - `verdict` 'synthetic' | 'non-synthetic' | 'no-content', required — Classification for this frame: - `synthetic` - the frame likely contains AI-generated speech. - `non-synthetic` - the frame likely contains natural human speech. - `no-content` - the frame is silent or contains no usable audio.
    - `confidence` number, double, required — Confidence in the stated verdict, from 0 (lowest) to 1 (highest).

## Other responses

- `400` — Bad request - the uploaded file is empty or its format is not supported.
- `403` — Forbidden - the request is not permitted.
- `422` — Unprocessable entity - a required request parameter is missing or invalid (for example, the `X-API-Key` header or the `upload_file` field).
- `429` — Too many requests - the request could not be completed due to insufficient credits.
- `500` — Internal server error during processing.
- `502` — Bad gateway - the request could not be validated.
- `503` — Service unavailable - the service is temporarily unavailable.

---

[API](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api.md) · [All operations](https://skmtc.dev/modulate/apis/velma-2-accent-batch-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/modulate/velma-2-accent-batch-api/revisions/b4c9ce648efa/schema)
