Class TtsModel

A text-to-speech model. This is a model that can be used to generate audio from text. Models are trained to synthesize speech in a specific language and voice.

Implements

Constructors

  • Parameters

    • client: Client

      The main client.

    • data: {
          category_tokens: null | string[];
          created_at: Date;
          creator_display_name: string;
          creator_gravatar_hash: string;
          creator_user_token: string;
          creator_username: string;
          ietf_language_tag: string;
          ietf_primary_language_subtag: string;
          is_front_page_featured: boolean;
          is_twitch_featured: boolean;
          maybe_suggested_unique_bot_command: null | string;
          model_token: string;
          title: string;
          tts_model_type: string;
          updated_at: Date;
      }

      The data that has arrived from the FakeYou API.

      • category_tokens: null | string[]
      • created_at: Date
      • creator_display_name: string
      • creator_gravatar_hash: string
      • creator_user_token: string
      • creator_username: string
      • ietf_language_tag: string
      • ietf_primary_language_subtag: string
      • is_front_page_featured: boolean
      • is_twitch_featured: boolean
      • maybe_suggested_unique_bot_command: null | string
      • model_token: string
      • title: string
      • tts_model_type: string
      • updated_at: Date

    Returns TtsModel

Properties

categoryTokens: null | string[]
client: Client
createdAt: Date
creatorDisplayName: string
creatorGravatarHash: string
creatorToken: string
creatorUsername: string
fetchProfile: ((this) => Promise<ProfileUser | undefined>) = implFetchUser

Fetch the user who created this model.

Type declaration

    • (this): Promise<ProfileUser | undefined>
    • Fetch the user who created this model.

      Parameters

      Returns Promise<ProfileUser | undefined>

ietfLanguageTag: string
ietfPrimaryLanguageSubtag: string
isFrontPageFeatured: boolean
isTwitchFeatured: boolean
suggestedUniqueBotCommand: null | string
title: string

The name of this model, which is shown on the website's dropdown menu.

token: string
ttsModelType: string

The type of this model. E.g. 'tacotron2'.

updatedAt: Date
username: string

Alias

creatorUsername

webUrl: string

The URL to the page of this model in the browser.

Methods

  • Parameters

    • text: string

    Returns Promise<{
        inference_job_token: string;
        success: true;
    } | {
        error_reason: string;
        success: false;
    }>

  • Parameters

    • inferenceJobToken: string

    Returns Promise<undefined | {
        attempt_count: number;
        created_at: Date;
        job_token: string;
        maybe_extra_status_description: null | "done";
        maybe_public_bucket_wav_audio_path: string;
        maybe_result_token: string;
        model_token: string;
        raw_inference_text: string;
        status: "complete_success";
        title: string;
        tts_model_type: string;
        updated_at: Date;
    }>

  • Fetch the rating of this model by the currently logged in user.

    Returns Promise<undefined | "positive" | "negative" | "neutral">

    The rating of this model by the currently logged in user. Ratings can be 'positive', 'negative', or 'neutral'. Undefined if no user is logged in.

  • Fetch the parent categories of this model.

    Returns Promise<Category[]>

    The parent categories of this model. The array will be empty if no categories are found.

  • Infer text for this model.

    Parameters

    • text: string

      The text to infer.

    Returns Promise<undefined | TtsAudioFile>

    The audio file of the inference. Undefined if the inference failed or took too long.

  • Rate this model positively, negatively, or neutrally. Neutral is the same as removing your rating.

    Parameters

    • decision: "positive" | "negative" | "neutral"

      The rating. Can be 'positive', 'negative', or 'neutral'.

    Returns Promise<undefined | "positive" | "negative" | "neutral">

    The new rating of this model by the currently logged in user. Undefined if no user is logged in.

Generated using TypeDoc