Options
All
  • Public
  • Public/Protected
  • All
Menu

The AssemblyAI client that allows you to call the AssemblyAI V2 endpoints via various functions.

Hierarchy

  • AssemblyClient

Index

Constructors

Properties

httpClient: Axios

The Axios http client used to make requests to the AssemblyAI API.

Methods

  • Permanently delete a transcript by id. The record of the transcript will exist and remain queryable, however, all fields containing sensitive data (like text transcriptions) will be permanently deleted.

    Parameters

    • transcriptId: string

      The unique identifier of your transcription.

    Returns Promise<TranscriptResponse>

  • getAllTranscripts(limit?: number, status?: string, createdOn?: string, beforeId?: string, afterId?: string, throttledOnly?: boolean): Promise<AllTranscriptsResponse>
  • List all your transcripts.

    Parameters

    • limit: number = 10

      Max results to return in a single response, between 1 and 200 inclusive.

    • status: string = ''

      Filter by transcript status, "processing", "queued", "completed", or "error".

    • createdOn: string = ''

      Only return transcripts created on this date; format: "YYYY-MM-DD".

    • beforeId: string = ''

      Return transcripts that were created before this transcript id.

    • afterId: string = ''

      Return transcripts that were created after this transcript id.

    • throttledOnly: boolean = false

      Only return throttled transcripts, overrides status filter.

    Returns Promise<AllTranscriptsResponse>

    A paginated AllTranscriptsResponse with {@link limit} transcript results.

  • pollForTranscript(transcriptId: string, pollTimeout?: number, pollInterval?: number): Promise<TranscriptResponse>
  • Poll for a transcript.

    Parameters

    • transcriptId: string

      The unique identifier of your transcription.

    • pollTimeout: number = ...

      The amount of time to poll for before timing out.

    • pollInterval: number = ...

      The amount of time in ms to wait between each call to see if the transcript is complete.

    Returns Promise<TranscriptResponse>

    A TranscriptResponse when the transcript TranscriptResponse.status === completed.

  • If you're working with short bursts of audio, less than 15 seconds, you can send the audio data directly to the /v2/stream endpoint which will return a transcript to you within a few hundred milliseconds, directly in the request-response loop.

    Audio Requirements

    The audio data you send to this endpoint has to comply with a strict format. This is because we don't do any transcoding to your data, we send it directly to the model for transcription. You can send the content of a .wav file to this endpoint, or raw data read directly from a microphone. Either way, you must record your audio in the following format to use this endpoint:

    • 16-bit Signed Integer PCM encoding (ie, a .wav file)
    • 8khz sampling rate
    • 128kbps bitrate
    • 16-bit Precision
    • Single channel
    • Headless (ie, strip any headers from wav files)
    • 15 seconds or less of audio per request

    Parameters

    Returns Promise<StreamResponse>

    A StreamResponse. Depending on how much audio data you send, the API will respond within 100-750 milliseconds.

Generated using TypeDoc