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

# Stream audio



## AsyncAPI

````yaml asyncapi.yaml root
id: root
title: Root
description: ''
servers: []
address: <generated url from /v1/live endpoint>
parameters: []
bindings:
  - protocol: ws
    version: latest
    value:
      query:
        type: object
        description: >
          The token is embedded in the WebSocket URL returned by the POST
          /v1/live REST endpoint. It is single-use and grants access only to
          this stream session — it carries no team credentials or API key.
        properties:
          token:
            type: string
            description: >-
              Single-use temporary token generated when creating a stream
              session via POST /v1/live.
    schemaProperties:
      - name: query
        type: object
        description: >
          The token is embedded in the WebSocket URL returned by the POST
          /v1/live REST endpoint. It is single-use and grants access only to
          this stream session — it carries no team credentials or API key.
        required: false
        properties:
          - name: token
            type: string
            description: >-
              Single-use temporary token generated when creating a stream
              session via POST /v1/live.
            required: false
operations:
  - &ref_2
    id: sendAudioChunk
    title: Send audio chunk
    description: Stream a raw PCM audio chunk to the server.
    type: receive
    messages:
      - &ref_7
        id: binaryAudioChunk
        contentType: application/octet-stream
        payload:
          - type: string
            format: binary
            description: Raw PCM audio chunk (binary frame).
            examples: &ref_0
              - <binary pcm_f32le 100ms audio chunk>
            x-parser-schema-id: binaryAudioChunk
            name: binaryAudioChunk
        headers: []
        jsonPayloadSchema:
          type: string
          format: binary
          description: >
            Raw binary audio data. PCM float 32-bit little-endian (pcm_f32le),
            16 kHz sample rate, mono channel, 100 ms per chunk (1600 samples /
            6400 bytes).
          examples: *ref_0
          x-parser-schema-id: binaryAudioChunk
        title: Binary audio chunk
        description: Raw PCM audio chunk (binary frame).
        example: '"<binary pcm_f32le 100ms audio chunk>"'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: binaryAudioChunk
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: root
  - &ref_3
    id: sendEndOfStream
    title: Send end of stream
    description: Signal that no more audio will be sent.
    type: receive
    messages:
      - &ref_8
        id: endOfStream
        contentType: application/json
        payload:
          - name: endOfStream
            description: End-of-stream signal.
            type: object
            properties:
              - name: type
                type: string
                description: end_of_stream
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              const: end_of_stream
              x-parser-schema-id: <anonymous-schema-1>
          examples:
            - type: end_of_stream
          x-parser-schema-id: endOfStream
        title: End of stream
        description: End-of-stream signal.
        example: |-
          {
            "type": "end_of_stream"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: endOfStream
    bindings: []
    extensions: *ref_1
  - &ref_4
    id: receiveSpeakerStart
    title: Receive speaker start
    description: A speaker begins a turn.
    type: send
    messages:
      - &ref_9
        id: diarizationSpeakerStart
        contentType: application/json
        payload:
          - name: diarizationSpeakerStart
            description: Emitted when a speaker begins a turn.
            type: object
            properties:
              - name: type
                type: string
                description: diarization_speaker_start
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: timestamp
                    type: number
                    description: >-
                      Time in seconds from the start of the stream when the
                      speaker turn began.
                    required: true
                  - name: speaker
                    type: string
                    description: >-
                      Stable label for this speaker within the session. Up to 8
                      speakers are tracked simultaneously.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - data
          properties:
            type:
              type: string
              const: diarization_speaker_start
              x-parser-schema-id: <anonymous-schema-2>
            data:
              type: object
              required:
                - timestamp
                - speaker
              properties:
                timestamp:
                  type: number
                  description: >-
                    Time in seconds from the start of the stream when the
                    speaker turn began.
                  example: 1.24
                  x-parser-schema-id: <anonymous-schema-4>
                speaker:
                  type: string
                  description: >-
                    Stable label for this speaker within the session. Up to 8
                    speakers are tracked simultaneously.
                  example: SPEAKER_00
                  x-parser-schema-id: <anonymous-schema-5>
              x-parser-schema-id: <anonymous-schema-3>
          examples:
            - type: diarization_speaker_start
              data:
                timestamp: 1.24
                speaker: SPEAKER_00
          x-parser-schema-id: diarizationSpeakerStart
        title: Diarization speaker start
        description: Emitted when a speaker begins a turn.
        example: |-
          {
            "type": "diarization_speaker_start",
            "data": {
              "timestamp": 1.24,
              "speaker": "SPEAKER_00"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: diarizationSpeakerStart
    bindings: []
    extensions: *ref_1
  - &ref_5
    id: receiveSpeakerEnd
    title: Receive speaker end
    description: A speaker's turn ends.
    type: send
    messages:
      - &ref_10
        id: diarizationSpeakerEnd
        contentType: application/json
        payload:
          - name: diarizationSpeakerEnd
            description: Emitted when a speaker's turn ends.
            type: object
            properties:
              - name: type
                type: string
                description: diarization_speaker_end
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: timestamp
                    type: number
                    description: >-
                      Time in seconds from the start of the stream when the
                      speaker turn ended.
                    required: true
                  - name: speaker
                    type: string
                    description: Stable label for this speaker within the session.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - data
          properties:
            type:
              type: string
              const: diarization_speaker_end
              x-parser-schema-id: <anonymous-schema-6>
            data:
              type: object
              required:
                - timestamp
                - speaker
              properties:
                timestamp:
                  type: number
                  description: >-
                    Time in seconds from the start of the stream when the
                    speaker turn ended.
                  example: 3.86
                  x-parser-schema-id: <anonymous-schema-8>
                speaker:
                  type: string
                  description: Stable label for this speaker within the session.
                  example: SPEAKER_00
                  x-parser-schema-id: <anonymous-schema-9>
              x-parser-schema-id: <anonymous-schema-7>
          examples:
            - type: diarization_speaker_end
              data:
                timestamp: 3.863
                speaker: SPEAKER_00
          x-parser-schema-id: diarizationSpeakerEnd
        title: Diarization speaker end
        description: Emitted when a speaker's turn ends.
        example: |-
          {
            "type": "diarization_speaker_end",
            "data": {
              "timestamp": 3.863,
              "speaker": "SPEAKER_00"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: diarizationSpeakerEnd
    bindings: []
    extensions: *ref_1
  - &ref_6
    id: receiveError
    title: Receive error
    description: The server encountered a problem processing a frame.
    type: send
    messages:
      - &ref_11
        id: error
        contentType: application/json
        payload:
          - name: error
            description: Emitted when the server encounters a problem processing a frame.
            type: object
            properties:
              - name: type
                type: string
                description: error
                required: true
              - name: message
                type: string
                description: Human-readable description of the error.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              const: error
              x-parser-schema-id: <anonymous-schema-10>
            message:
              type: string
              description: Human-readable description of the error.
              example: Invalid chunk size
              x-parser-schema-id: <anonymous-schema-11>
          examples:
            - type: error
              message: Invalid chunk size
          x-parser-schema-id: error
        title: Error
        description: Emitted when the server encounters a problem processing a frame.
        example: |-
          {
            "type": "error",
            "message": "Invalid chunk size"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
  - *ref_3
receiveOperations:
  - *ref_4
  - *ref_5
  - *ref_6
sendMessages:
  - *ref_7
  - *ref_8
receiveMessages:
  - *ref_9
  - *ref_10
  - *ref_11
extensions:
  - id: x-parser-unique-object-id
    value: root
securitySchemes: []

````