Creates a transcript and loads subtitles for the transcript as srt or vtt format.

Example

const loader = new AudioSubtitleLoader(
{
audio_url: "https:
},
"srt",
{
apiKey: "<ASSEMBLYAI_API_KEY>",
},
);


const docs = await loader.load();

Hierarchy

  • CreateTranscriptLoader
    • AudioSubtitleLoader

Constructors

  • Creates a new AudioSubtitleLoader.

    Parameters

    • CreateTranscriptParameters: CreateTranscriptParameters

      The parameters to create the transcript.

    • subtitleFormat: SubtitleFormat

      The format of the subtitles, either srt or vtt.

    • Optional assemblyAIOptions: AssemblyAIOptions

      The options to configure the AssemblyAI loader. Configure the assemblyAIOptions.apiKey with your AssemblyAI API key, or configure it as the ASSEMBLYAI_API_KEY environment variable.

    Returns AudioSubtitleLoader

  • Creates a new AudioSubtitleLoader.

    Parameters

    • transcriptId: string

      The ID of the transcript to retrieve.

    • subtitleFormat: SubtitleFormat

      The format of the subtitles, either srt or vtt.

    • Optional assemblyAIOptions: AssemblyAIOptions

      The options to configure the AssemblyAI loader. Configure the assemblyAIOptions.apiKey with your AssemblyAI API key, or configure it as the ASSEMBLYAI_API_KEY environment variable.

    Returns AudioSubtitleLoader

Properties

client: AssemblyAI
CreateTranscriptParameters?: CreateTranscriptParameters
transcriptId?: string

Methods

  • Creates a transcript and loads subtitles for the transcript as srt or vtt format.

    Returns Promise<Document<Record<string, any>>[]>

    A promise that resolves a document containing the subtitles as the page content.

  • Loads the documents and splits them using a specified text splitter.

    Parameters

    Returns Promise<Document<Record<string, any>>[]>

    A Promise that resolves with an array of Document instances, each split according to the provided TextSplitter.

  • Returns Promise<any>

Generated using TypeDoc