> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulate.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Audio Event Detection Batch

> Detect non-speech sound events in an audio file. Returns a probability for each event confidently detected, plus the audio duration, in a single synchronous response.



## OpenAPI

````yaml api/velma_2_audio_event_classifier.yaml POST /api/velma-2-audio-event-classifier
openapi: 3.1.0
info:
  title: Velma 2 Audio Event Detection API
  version: 0.0.0
  description: >
    Audio event detection via HTTP POST. Submit an audio file, get back a

    single JSON response with a probability for each supported event and the

    audio duration. Detects crying, laughter, acoustic guitar, applause, bark,

    bass drum, burping, bus, cello, chime, clarinet, computer keyboard, cough,

    cowbell, double bass, drawer open/close, electric piano, fart, finger
    snapping,

    fireworks, flute, glockenspiel, gong, gunshot/gunfire, harmonica, hi-hat,

    keys jangling, knock, meow, microwave oven, oboe, saxophone, scissors,

    shatter, snare drum, squeak, tambourine, tearing, telephone, trumpet,
    violin/fiddle,

    writing. No transcription, diarization, or PII/PHI tagging.
servers:
  - url: https://platform.modulate.ai
    description: Modulate Audio Event Detection Server
security:
  - ApiKeyAuth: []
paths:
  /api/velma-2-audio-event-classifier:
    post:
      summary: Detect audio events in an audio file
      description: |
        Accepts a single audio file and returns a probability for each
        supported event as a synchronous JSON response.
      operationId: detectEvents
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - upload_file
              properties:
                upload_file:
                  type: string
                  format: binary
                  description: |
                    Audio file to analyze. Must be non-empty and of a
                    supported format. Supported formats: AAC, AIFF, FLAC,
                    MP3, MP4, MOV, OGG, Opus, WAV, WebM. Maximum file size:
                    100 MB.
      responses:
        '200':
          description: Event detection completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventDetectionResponse'
              examples:
                co_occurring_events:
                  summary: Clip containing both applause and laughter
                  value:
                    probs:
                      Applause: 0.998
                      Laughter: 0.946
                    duration_ms: 2000
                crying_detected:
                  summary: Clip containing crying
                  value:
                    probs:
                      Crying: 0.94
                    duration_ms: 14253
                no_event_detected:
                  summary: Clip with no confidently detected event
                  value:
                    probs: {}
                    duration_ms: 5400
        '400':
          description: >
            Bad request - the uploaded file is empty, its format is not
            supported, or the audio could not be decoded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_format:
                  summary: Invalid file format
                  value:
                    detail: >-
                      Unsupported file format. Supported formats: .aac, .aiff,
                      .flac, .mp3, .mp4, .mov, .ogg, .opus, .wav, .webm.
                empty_file:
                  summary: Empty file
                  value:
                    detail: The uploaded file is empty.
                unprocessable:
                  summary: Audio could not be decoded
                  value:
                    detail: >-
                      The audio could not be processed. It may be corrupted or
                      in an unsupported format.
                bad_value:
                  summary: Malformed request value
                  value:
                    detail: Invalid request.
        '401':
          description: Unauthorized - the API key was not recognized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Invalid API key.
        '403':
          description: Forbidden - the request is not permitted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_permitted:
                  summary: Request not permitted
                  value:
                    detail: This request is not permitted.
                model_access_denied:
                  summary: API key lacks access to this model
                  value:
                    detail: This API key does not have access to this model.
        '413':
          description: Payload too large - the uploaded file exceeds the maximum file size.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: The uploaded file is too large.
        '422':
          description: >
            Unprocessable entity - a required request parameter is missing or
            invalid (for example, the `X-API-Key` header or the `upload_file`
            field).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            Too many requests - insufficient credits or a usage limit was
            reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                insufficient_credits:
                  summary: Insufficient credits
                  value:
                    detail: Insufficient credits.
                concurrency_limit:
                  summary: Concurrent request limit reached
                  value:
                    detail: >-
                      Concurrent request limit reached. Please retry after your
                      in-flight requests complete.
                monthly_limit:
                  summary: Monthly usage limit reached
                  value:
                    detail: Monthly usage limit reached.
        '500':
          description: Internal server error during processing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: Internal server error
        '503':
          description: Service unavailable - the service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: >-
                  The service is temporarily unavailable. Please try again
                  later.
        '504':
          description: Gateway timeout - processing timed out.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                detail: The request timed out. Please try again.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    EventDetectionResponse:
      type: object
      required:
        - probs
        - duration_ms
      properties:
        probs:
          type: object
          description: |
            Per-event probabilities, each between 0 and 1. Only events
            confidently detected in the audio are included - an omitted
            event was not detected with sufficient confidence, which does
            not necessarily mean it is absent from the audio. Included
            events are not mutually exclusive, and the set of included
            probabilities is not expected to sum to 1. `probs` is an empty
            object when no event was confidently detected.
          properties:
            Crying:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains crying.
              example: 0.94
            Acoustic_guitar:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains an acoustic guitar.
            Applause:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains applause.
            Bark:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a dog bark.
            Bass_drum:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a bass drum.
            Burping_or_eructation:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains burping.
            Bus:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a bus.
            Cello:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a cello.
            Chime:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a chime.
            Clarinet:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a clarinet.
            Computer_keyboard:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a computer keyboard.
            Cough:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a cough.
            Cowbell:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a cowbell.
            Double_bass:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a double bass.
            Drawer_open_or_close:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a drawer opening or closing.
            Electric_piano:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains an electric piano.
            Fart:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains flatulence.
            Finger_snapping:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains finger snapping.
            Fireworks:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains fireworks.
            Flute:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a flute.
            Glockenspiel:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a glockenspiel.
            Gong:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a gong.
            Gunshot_or_gunfire:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a gunshot.
            Harmonica:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a harmonica.
            Hi_hat:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a hi-hat cymbal.
            Keys_jangling:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains keys jangling.
            Knock:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains knocking.
            Laughter:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains laughter.
              example: 0.94
            Meow:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a cat meowing.
            Microwave_oven:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a microwave oven.
            Oboe:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains an oboe.
            Saxophone:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a saxophone.
            Scissors:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains scissors cutting.
            Shatter:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains glass shattering.
            Snare_drum:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a snare drum.
            Squeak:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a squeak.
            Tambourine:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a tambourine.
            Tearing:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains paper or fabric tearing.
            Telephone:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a ringing telephone.
            Trumpet:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a trumpet.
            Violin_or_fiddle:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains a violin.
            Writing:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio contains writing (e.g. with a pen or
                pencil).
        duration_ms:
          type: integer
          minimum: 0
          description: |
            The total duration of the processed audio in milliseconds.
          example: 14253
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key used for authentication and usage tracking.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.