This page documents the utility functions and supporting classes exported by the TextAlive App API SDK.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/TextAliveJp/textalive-app-api/llms.txt
Use this file to discover all available pages before exploring further.
Timed object search
findTimedObject
time. Returns undefined if no object contains the specified time (unless loose is set).
A sorted array of
TimedObject instances.The target time in milliseconds.
Optional search modifiers. See FindTimedObjectOptions.
findTimedObjectsInRange
[startTime, endTime]. Use this in onTimeUpdate to detect transitions — for example, characters that began or finished vocalization during the last frame.
A sorted array of
TimedObject instances.Start of the query range in milliseconds.
End of the query range in milliseconds.
Data URL utilities
dataUrlToString
A Base64-encoded data URL.
stringToDataUrl
dataUrlToString).
The UTF-8 string to encode.
isStringEncodedDataUrl
true if the given string is a Base64-encoded data URL that encodes a UTF-8 string.
The string to test.
Supporting types
TimedObject
The base interface for all time-ranged objects in the API.Start of the time range in milliseconds.
End of the time range in milliseconds.
Returns
true if the time range contains the given time (start and end inclusive).Returns
true if another TimedObject’s range overlaps this range.TimedUnit
TimedUnit is an abstract base class you can extend to create custom timed objects compatible with the findTimedObject and findTimedObjectsInRange APIs.
TimedUnit and provide startTime and endTime to gain duration, contains, overlaps, and progress for free:
ValenceArousalValue
The return type ofplayer.getValenceArousal() and player.getMedianValenceArousal(). Both values are normalized to the range [-1, 1] and are comparable across songs (not relative to a single song).
Valence — the positivity/negativity of the music’s emotional content. Ranges from
-1 (negative) to 1 (positive).Arousal — the energy/excitement level of the music. Ranges from
-1 (calm) to 1 (excited).You must set
valenceArousalEnabled: true in PlayerOptions before loading a song for valence/arousal data to be available.UnitTypes
A constant object containing the numeric type codes returned byIRenderingUnit.getType().
UnitTypes to check the type of any rendering unit:
FindTimedObjectOptions
Controls the behavior offindTimedObject. Provide one of the following shapes:
When set,
findTimedObject returns an object that overlaps the range [time, endTime] rather than a single point in time.When
true, the nearest result from the binary search is always returned, even if the specified time is not contained within the object’s range.TimedObjectsInRange<T>
The return type offindTimedObjectsInRange and the findXxxChange methods on IPlayer and IVideo.
The timed object that overlaps with the end time of the queried range, or
null.Objects whose
startTime falls within the queried range.Objects whose
endTime falls within the queried range.The last timed object that ends before the queried range, or
null.The first timed object that starts after the queried range, or
null.DecomposedProps
The result of decomposing aMatrix2D into its component transform values.
Horizontal translation.
Vertical translation.
Horizontal scale factor.
Vertical scale factor.
Horizontal skew in degrees.
Vertical skew in degrees.
Rotation in degrees.
Matrix2D
Matrix2D represents a 3x3 affine transformation matrix in the form:
this, making them chainable.
Constructor
Static members
A shared identity matrix representing a null transformation. Do not mutate this instance.
Multiplier for converting degrees to radians (
Math.PI / 180).Instance properties
Position (0, 0) in the matrix.
Position (0, 1) in the matrix.
Position (1, 0) in the matrix.
Position (1, 1) in the matrix.
Horizontal translation (position (2, 0)).
Vertical translation (position (2, 1)).
Methods
Sets all matrix values at once. Returns
this.Appends raw matrix properties: equivalent to
this * specified. Returns this.Prepends raw matrix properties: equivalent to
specified * this. Returns this.Appends another
Matrix2D: equivalent to this * matrix. Returns this.Prepends another
Matrix2D: equivalent to matrix * this. Returns this.Generates matrix values from display-object transform properties and appends them to this matrix. Returns
this.Applies a clockwise rotation.
angle is in degrees; multiply by Matrix2D.DEG_TO_RAD to use radians. Returns this.Applies a scale transformation. Returns
this.Translates the matrix on the x and y axes. Returns
this.Applies a skew transformation. Both arguments are in degrees. Returns
this.Resets the matrix to the identity transformation. Returns
this.Inverts the matrix so it performs the opposite transformation. Returns
this.Returns
true if this is an identity matrix.Returns
true if all property values equal those of matrix.Decomposes the matrix into
x, y, scaleX, scaleY, skewX, skewY, and rotation. If target is provided, properties are written to it; otherwise a new object is returned.Transforms a point according to this matrix. If
pt is provided, the result is written into it; otherwise a new object is returned.Returns a new
Matrix2D with the same values.Copies all properties from
matrix into this instance. Returns this.Returns a string representation of this matrix.
Point
Point represents a coordinate on a 2D x/y plane.
Constructor
Properties
The x coordinate.
The y coordinate.
Methods
Sets
x and y. Returns this.Returns a new
Point with the same coordinates.Copies coordinates from
point into this instance. Returns this.Returns a string representation of this point.
Other exports
PlayerLogoImage
.bg— background fill (default:#1f4391).fg— foreground fill (default:#fff)
RegionalText
"ja" key for Japanese and the "en" key for English.