Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Conversation

Hierarchy

  • Conversation

Index

Events Methods

onClose

  • Subscribe to Conversation onClose event.

    example
    const uhlive = new Uhlive("my-token");
    const conversation = uhlive.join("test");
    conversation.onClose((msg) => console.log(msg))

    Parameters

    • callback: (payload: any) => void
        • (payload: any): void
        • Parameters

          • payload: any

          Returns void

    Returns Conversation

onEntityNumberFound

  • This event is triggered when the backend detected a number entity.

    example
    const uhlive = new Uhlive("my-token");
    const myConversation = uhlive.join("my-conversation");
    myConversation.onEntityNumberFound((entity) => {
        // Do something with `entity`...
    });

    Parameters

    Returns Conversation

onEntityOrdinalFound

  • This event is triggered when the backend detected an ordinal entity.

    example
    const uhlive = new Uhlive("my-token");
    const myConversation = uhlive.join("my-conversation");
    myConversation.onEntityOrdinalFound((entity) => {
        // Do something with `entity`...
    });

    Parameters

    Returns Conversation

onError

  • Subscribe to Conversation onError event.

    example
    const uhlive = new Uhlive("my-token");
    const conversation = uhlive.join("test");
    conversation.onError((msg) => console.log(msg))

    Parameters

    • callback: (payload: any) => void
        • (payload: any): void
        • Parameters

          • payload: any

          Returns void

    Returns Conversation

onSegmentDecoded

  • This event is triggered when the backend send a final transcript.

    example
    const uhlive = new Uhlive("my-token");
    const myConversation = uhlive.join("my-conversation");
    myConversation.onSegmentDecoded((transcript) => {
        // Do something with `transcript`...
    });

    Parameters

    Returns Conversation

onSpeakerLeft

  • onSpeakerLeft(callback: (speaker: string) => void): Conversation
  • The speaker_left event is triggered when a speaker leaves, or more abruptly, closes its connection. This event is published after all remaining transcript events of this speaker have been published.

    example
    const uhlive = new Uhlive("my-token");
    const myConversation = uhlive.join("my-conversation");
    myConversation.onSpeakerLeft((speaker) => {
        // Do something with `speaker`...
    });

    Parameters

    • callback: (speaker: string) => void
        • (speaker: string): void
        • Parameters

          • speaker: string

          Returns void

    Returns Conversation

onWordsDecoded

  • The words_decoded event is triggered when the backend sends an interim transcript. Following words_decoded events for the same audio are susceptible to be different, until a final transcript is sent with the segment_decoded event.

    example
    const uhlive = new Uhlive("my-token");
    const myConversation = uhlive.join("my-conversation");
    myConversation.onWordsDecoded((transcript) => {
        // Do something with `transcript`...
    });

    Parameters

    Returns Conversation

Recording Methods

isRecording

  • isRecording(): boolean
  • Get the recording status of the conversation.

    example
    const uhlive = new Uhlive("my-token");
    uhlive
        .join("my-conversation")
        .isRecording(); // true
    example
    const uhlive = new Uhlive("my-token");
    uhlive
        .join("my-conversation", {readonly: true})
        .isRecording(); // false

    Returns boolean