LyricsLine
ClassRepresents a single line of Lyrics.
- Available on all platforms
Index
Properties
Methods
Example
const externalMusicModule = require("LensStudio:ExternalMusicModule") as ExternalMusicModule;
@component
export class LyricsExample extends BaseScriptComponent {
// Make sure an AudioTrack asset is included in the scene. It determines the track that plays.
// If you see errors, make sure that "Bundled" is unchecked (disabled) on the AudioTrack.
@input audioAsset: AudioTrackAsset;
onAwake() {
const lyricsTracker = externalMusicModule.getLyricsTracker();
lyricsTracker.onLineStart.add(line => {
print("Line started with the text: " + line.fullLineText);
print("Number of syncs within the line: " + line.syncs.length);
});
lyricsTracker.onLineEnd.add(line => {
print("The line has ended.")
});
}
}
Extends
Properties
fullLineText
readonlyfullLineText:string
The full line of lyrics represented as a single string.
offset
readonlyoffset:number
Offset (in seconds) that this line begins relative to the start of the tracked music. Note that this value can be negative, since music tracks can start halfway through a line being sung. This value is useful to compare with LyricsTracker.playbackPosition.
offsetEnd
readonlyoffsetEnd:number
Offset (in seconds) that this line ends relative to the start of the tracked music. This value is useful to compare with LyricsTracker.playbackPosition.
syncs
readonlysyncs:LyricsSync[]
Lyrics for this line represented as a list of LyricsSync objects in the order they appear.
Note that for LineSync lyrics data, only one LyricsSync object will be present in the list, representing the entire line.
Methods
getTypeName()
staticgetTypeName():TypeName<LyricsLine>
Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().
Returns
TypeName<LyricsLine>
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object matches or derives from the passed in type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean