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(() => {
      // Choose what to do when the conversation is closed.
    })

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    Returns Conversation

onEntityNumberFound

  • This event is triggered when a number entity has been found.

    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 an ordinal entity has been found.

    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

  • The onSegmentDecoded event is triggered when a final transcript is received.

    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. Note that users connected in read-only mode (observers) don't emit any event.

    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 an interim transcript is received. 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