@audiotool/nexus - v0.0.19
    Preparing search index...

    Class SampleGenerated

    Sample is a resource representing a single Sample.

    from message audiotool.sample.v1.Sample

    Hierarchy

    Index

    Constructors

    Properties

    bpm: number = 0

    The beats per minute of the Sample.

    from field: double bpm = 8;

    clearance: SampleClearance = SampleClearance.UNSPECIFIED

    The clearance of the Sample.

    from field: audiotool.sample.v1.SampleClearance clearance = 13;

    createTime?: Timestamp

    Output only. Timestamp when this Sample was created.

    from field: google.protobuf.Timestamp create_time = 11;

    description: string = ""

    The description of the Sample.

    from field: string description = 3;

    displayName: string = ""

    The display name of the Sample.

    from field: string display_name = 2;

    flacUrl: string = ""

    The underlying URL of the track to play (flac format).

    from field: string flac_url = 19;

    mp3Url: string = ""

    The underlying URL of the track to play (mp3 format).

    from field: string mp3_url = 16;

    name: string = ""

    The Sample name.

    from field: string name = 1;

    numFavorites: number = 0

    The number of favorites of the Sample.

    from field: int32 num_favorites = 6;

    numUsages: number = 0

    The number of usages of the Sample.

    from field: int32 num_usages = 7;

    ownerName: string = ""

    The Owner of the Sample in the form of users/{user}.

    from field: string owner_name = 4;

    playDuration?: Duration

    The duration of the Sample.

    from field: google.protobuf.Duration play_duration = 10;

    previewMp3Url: string = ""

    The underlying URL of the track to play (mp3 format).

    from field: string preview_mp3_url = 18;

    sampleType: SampleType = SampleType.UNSPECIFIED

    The type of the Sample.

    from field: audiotool.sample.v1.SampleType sample_type = 9;

    tags: string[] = []

    The tags of the Sample.

    from field: repeated string tags = 15;

    takedownReason: SampleTakedownReason = SampleTakedownReason.UNSPECIFIED

    Why this sample was taken down. UNSPECIFIED means it has not been taken down.

    When not UNSPECIFIED, usage is forced to UNLISTED and all URL fields above are empty. The row is kept so existing track references remain valid.

    from field: audiotool.sample.v1.SampleTakedownReason takedown_reason = 31;

    updateTime?: Timestamp

    Output only. Timestamp when this Sample was last updated.

    The underlying audio can't be changed. Only some metadata (of this message) can be changed.

    from field: google.protobuf.Timestamp update_time = 12;

    usage: SampleUsage = SampleUsage.UNSPECIFIED

    The usage of the Sample.

    After a takedown this is forced to SAMPLE_USAGE_UNLISTED.

    from field: audiotool.sample.v1.SampleUsage usage = 14;

    waveformUrl: string = ""

    The waveform URL of the sample.

    The waveform_url will be in the form of:

    "https://.../waveforms/v1/samples/{sample}/3840_both.json.gz?{SHA}"

    The SHA can be used for cache busting.

    If you need another resolution/channel variant you can replace 3840_both.json.gz with:

    • 3840_both.json.gz
    • 3840_left.json.gz
    • 3840_right.json.gz
    • 1920_both.json.gz
    • 1920_left.json.gz
    • 1920_right.json.gz
    • 480_both.json.gz
    • 480_left.json.gz
    • 480_right.json.gz

    Artifact format: the response body is Content-Encoding: gzip; after decompression the payload is a single JSON array of non-negative numbers — one peak/envelope sample per time bin. The array has at most as many elements as the numeric resolution prefix in the filename (e.g. 3840_*.json.gz is capped at 3840); the actual length is not guaranteed to match that cap. Each *_both|left|right*.json.gz file holds exactly one curve for that channel variant at that resolution (not a multi-key object).

    from field: string waveform_url = 20;

    wavUrl: string = ""

    The underlying URL of the track to play (wav format).

    from field: string wav_url = 17;

    fields: FieldList = ...
    runtime: ProtoRuntime = proto3
    typeName: "audiotool.sample.v1.Sample"

    Methods

    • Create a deep copy.

      Returns sample.Sample

    • Compare with a message of the same type. Note that this function disregards extensions and unknown fields.

      Parameters

      Returns boolean

    • Parse from binary data, merging fields.

      Repeated fields are appended. Map entries are added, overwriting existing keys.

      If a message field is already present, it will be merged with the new data.

      Parameters

      Returns this

    • Parse a message from a JSON value.

      Parameters

      • jsonValue: JsonValue
      • Optionaloptions: Partial<JsonReadOptions>

      Returns this

    • Parse a message from a JSON string.

      Parameters

      • jsonString: string
      • Optionaloptions: Partial<JsonReadOptions>

      Returns this

    • Retrieve the MessageType of this message - a singleton that represents the protobuf message declaration and provides metadata for reflection- based operations.

      Returns MessageType<sample.Sample>

    • Serialize the message to binary data.

      Parameters

      • Optionaloptions: Partial<BinaryWriteOptions>

      Returns Uint8Array

    • Serialize the message to a JSON value, a JavaScript value that can be passed to JSON.stringify().

      Parameters

      • Optionaloptions: Partial<JsonWriteOptions>

      Returns JsonValue

    • Override for serialization behavior. This will be invoked when calling JSON.stringify on this message (i.e. JSON.stringify(msg)).

      Note that this will not serialize google.protobuf.Any with a packed message because the protobuf JSON format specifies that it needs to be unpacked, and this is only possible with a type registry to look up the message type. As a result, attempting to serialize a message with this type will throw an Error.

      This method is protected because you should not need to invoke it directly -- instead use JSON.stringify or toJsonString for stringified JSON. Alternatively, if actual JSON is desired, you should use toJson.

      Returns JsonValue

    • Serialize the message to a JSON string.

      Parameters

      • Optionaloptions: Partial<JsonWriteStringOptions>

      Returns string