Class UserAudioFile

An implementation to fetch audio related data.

Implements

Constructors

  • Parameters

    • client: Client

      The main client.

    • data: {
          created_at: Date;
          duration_millis: number;
          file_size_bytes: number;
          maybe_creator_display_name: string;
          maybe_creator_result_id: number;
          maybe_creator_user_token: string;
          maybe_creator_username: string;
          public_bucket_wav_audio_path: string;
          raw_inference_text: string;
          tts_model_title: string;
          tts_model_token: string;
          tts_result_token: string;
          updated_at: Date;
          visibility: "public" | "hidden";
      }

      The raw user audio file data from the FakeYou API.

      • created_at: Date
      • duration_millis: number
      • file_size_bytes: number
      • maybe_creator_display_name: string
      • maybe_creator_result_id: number
      • maybe_creator_user_token: string
      • maybe_creator_username: string
      • public_bucket_wav_audio_path: string
      • raw_inference_text: string
      • tts_model_title: string
      • tts_model_token: string
      • tts_result_token: string
      • updated_at: Date
      • visibility: "public" | "hidden"

    Returns UserAudioFile

Properties

client: Client
createdAt: Date
creatorDisplayName: string
creatorResultId: number
creatorUserToken: string
creatorUsername: string
durationMillis: number
fetchProfile: ((this) => Promise<ProfileUser | undefined>) = implFetchUser

Fetch the user that created this audio file.

Type declaration

    • (this): Promise<ProfileUser | undefined>
    • Fetch the user that created this audio file.

      Parameters

      Returns Promise<ProfileUser | undefined>

fileSizeBytes: number
publicBucketWavAudioPath: string
rawInferenceText: string
resourceUrl: string

The external URL to the audio file. Expects a WAV file.

toBase64: ((this) => Promise<string | undefined>) = implToBase64

Convert the audio file to a base64 string.

Type declaration

    • (this): Promise<string | undefined>
    • Convert the audio file to a base64 string.

      Parameters

      Returns Promise<string | undefined>

toBuffer: ((this) => Promise<Buffer | undefined>) = implToBuffer

Fetch the audio file as a buffer.

Type declaration

    • (this): Promise<Buffer | undefined>
    • Fetch the audio file as a buffer.

      Parameters

      Returns Promise<Buffer | undefined>

toDisk: ((this, location) => Promise<void>) = implToDisk

Write the audio file to disk.

Type declaration

    • (this, location): Promise<void>
    • Write the audio file to disk.

      Parameters

      • this: Audio
      • location: `${string}.wav`

      Returns Promise<void>

ttsModelTitle: string
ttsModelToken: string
ttsResultToken: string
updatedAt: Date
username: string

Alias

creatorUsername

visibility: string
webUrl: string

The URL to view this audio file in a browser.

Methods

Generated using TypeDoc