> ## 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 every supported event, 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 English 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 English Audio Event Detection Server
security:
  - ApiKeyAuth: []
paths:
  /api/velma-2-audio-event-classifier:
    post:
      summary: Detect audio events in an English audio file
      description: |
        Accepts a single audio file and returns a probability for each
        supported event as a synchronous JSON response.
      operationId: detectEventsEnglish
      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:
                laughter_detected:
                  summary: Clip containing laughter
                  value:
                    probs:
                      cry: 0.01
                      Acoustic_guitar: 0.002
                      Applause: 0.03
                      Bark: 0.001
                      Bass_drum: 0.001
                      Burping_or_eructation: 0.002
                      Bus: 0.001
                      Cello: 0.001
                      Chime: 0.001
                      Clarinet: 0.001
                      Computer_keyboard: 0.001
                      Cough: 0.01
                      Cowbell: 0.001
                      Double_bass: 0.001
                      Drawer_open_or_close: 0.001
                      Electric_piano: 0.001
                      Fart: 0.002
                      Finger_snapping: 0.005
                      Fireworks: 0.001
                      Flute: 0.001
                      Glockenspiel: 0.001
                      Gong: 0.001
                      Gunshot_or_gunfire: 0.001
                      Harmonica: 0.001
                      Hi-hat: 0.001
                      Keys_jangling: 0.001
                      Knock: 0.002
                      Laughter: 0.913
                      Meow: 0.001
                      Microwave_oven: 0.001
                      Oboe: 0.001
                      Saxophone: 0.001
                      Scissors: 0.001
                      Shatter: 0.001
                      Snare_drum: 0.001
                      Squeak: 0.001
                      Tambourine: 0.001
                      Tearing: 0.001
                      Telephone: 0.002
                      Trumpet: 0.001
                      Violin_or_fiddle: 0.001
                      Writing: 0.001
                    duration_ms: 2000
                crying_detected:
                  summary: Clip containing crying
                  value:
                    probs:
                      cry: 0.94
                      Acoustic_guitar: 0.0244
                      Applause: 0.0244
                      Bark: 0.0244
                      Bass_drum: 0.0244
                      Burping_or_eructation: 0.0244
                      Bus: 0.0244
                      Cello: 0.0244
                      Chime: 0.0244
                      Clarinet: 0.0244
                      Computer_keyboard: 0.0244
                      Cough: 0.0244
                      Cowbell: 0.0244
                      Double_bass: 0.0244
                      Drawer_open_or_close: 0.0244
                      Electric_piano: 0.0244
                      Fart: 0.0244
                      Finger_snapping: 0.0244
                      Fireworks: 0.0244
                      Flute: 0.0244
                      Glockenspiel: 0.0244
                      Gong: 0.0244
                      Gunshot_or_gunfire: 0.0244
                      Harmonica: 0.0244
                      Hi-hat: 0.0244
                      Keys_jangling: 0.0244
                      Knock: 0.0244
                      Laughter: 0.0244
                      Meow: 0.0244
                      Microwave_oven: 0.0244
                      Oboe: 0.0244
                      Saxophone: 0.0244
                      Scissors: 0.0244
                      Shatter: 0.0244
                      Snare_drum: 0.0244
                      Squeak: 0.0244
                      Tambourine: 0.0244
                      Tearing: 0.0244
                      Telephone: 0.0244
                      Trumpet: 0.0244
                      Violin_or_fiddle: 0.0244
                      Writing: 0.0244
                    duration_ms: 14253
        '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.
        '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. `cry` is predicted
            independently. `Laughter` and every other entry are drawn from a
            single shared distribution.
          required:
            - cry
            - Acoustic_guitar
            - Applause
            - Bark
            - Bass_drum
            - Burping_or_eructation
            - Bus
            - Cello
            - Chime
            - Clarinet
            - Computer_keyboard
            - Cough
            - Cowbell
            - Double_bass
            - Drawer_open_or_close
            - Electric_piano
            - Fart
            - Finger_snapping
            - Fireworks
            - Flute
            - Glockenspiel
            - Gong
            - Gunshot_or_gunfire
            - Harmonica
            - Hi-hat
            - Keys_jangling
            - Knock
            - Laughter
            - Meow
            - Microwave_oven
            - Oboe
            - Saxophone
            - Scissors
            - Shatter
            - Snare_drum
            - Squeak
            - Tambourine
            - Tearing
            - Telephone
            - Trumpet
            - Violin_or_fiddle
            - Writing
          properties:
            cry:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio contains crying.
              example: 0.03
            Acoustic_guitar:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is an acoustic
                guitar.
            Applause:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is applause.
            Bark:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a dog bark.
            Bass_drum:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a bass drum.
            Burping_or_eructation:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is burping.
            Bus:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a bus.
            Cello:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a cello.
            Chime:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a chime.
            Clarinet:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a clarinet.
            Computer_keyboard:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a computer
                keyboard.
            Cough:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a cough.
            Cowbell:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a cowbell.
            Double_bass:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a double
                bass.
            Drawer_open_or_close:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a drawer
                opening or closing.
            Electric_piano:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is an electric
                piano.
            Fart:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is flatulence.
            Finger_snapping:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is finger
                snapping.
            Fireworks:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is fireworks.
            Flute:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a flute.
            Glockenspiel:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a
                glockenspiel.
            Gong:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a gong.
            Gunshot_or_gunfire:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a gunshot.
            Harmonica:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a harmonica.
            Hi-hat:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a hi-hat
                cymbal.
            Keys_jangling:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is keys
                jangling.
            Knock:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is 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's primary sound event is a cat
                meowing.
            Microwave_oven:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a microwave
                oven.
            Oboe:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is an oboe.
            Saxophone:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a saxophone.
            Scissors:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is scissors
                cutting.
            Shatter:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is glass
                shattering.
            Snare_drum:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a snare
                drum.
            Squeak:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a squeak.
            Tambourine:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a
                tambourine.
            Tearing:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is paper or
                fabric tearing.
            Telephone:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is a ringing
                telephone.
            Trumpet:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a trumpet.
            Violin_or_fiddle:
              type: number
              minimum: 0
              maximum: 1
              description: Probability that the audio's primary sound event is a violin.
            Writing:
              type: number
              minimum: 0
              maximum: 1
              description: >-
                Probability that the audio's primary sound event is 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.

````