@rendley/sdk - v1.15.5
    Preparing search index...

    Class AudioClip

    Clip implementation that plays and trims an audio-only media asset on the timeline.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    addActionToQueue addClipMask addEffect addFilter applyVolume clearAllCustomData clone destroy discardProcessing extractMonoAudioData generateNewId getAllCustomData getAnimationPropertyValue getAudioSamples getBlendMode getCustomData getDuration getEffectById getEffects getEndTime getFilterById getFilters getId getInsideTransition getIsProcessing getLayerId getLeftBound getLeftTrim getMasks getMediaId getName getPerservePitch getPlaybackSpeed getRightBound getRightTrim getStartTime getSubtitlesId getSubtitlesOffset getTransitionInId getTransitionOutId getTrimmedDuration getType getVisible getVolume getVolumeFadeInCurve getVolumeFadeInDuration getVolumeFadeOutCurve getVolumeFadeOutDuration getWrapMode hasCustomData hasName hasSprite hitTest init isActive isMuted isReady moveBy onPause onPlay onRenderDone onRenderStart onResize postRender preload processNextQueue registerEffectProperties registerFilterProperties removeAllEffectsByEffectId removeClipMask removeEffect removeFilter removeSubtitles render resetAllAnimationProperties resetAnimationPropertyValue serialize setAllCustomData setAnimationPropertyValue setBlendMode setCustomData setInsideInTransition setInsideOutTransition setLayerId setLeftTrim setMuted setName setPerservePitch setPlaybackSpeed setRightTrim setStartTime setSubtitles setSubtitlesId setSubtitlesOffset setTransitionInId setTransitionOutId setVisible setVolume setVolumeFadeInCurve setVolumeFadeInDuration setVolumeFadeOutCurve setVolumeFadeOutDuration setWrapMode unregisterEffectProperties unregisterFilterProperties update updateMediaData updateVisibility deserialize

    Constructors

    Properties

    animationController: AnimationClass
    id: string
    propertyAnimator: PropertyAnimator
    sprite: Sprite
    state: ClipState
    style: ClipStyle

    Methods

    • Queues an audio element action so it can run after the current async media operation completes.

      Parameters

      • action: string

        Action name such as play, pause, or seek.

      • params: object = {}

        Additional action parameters.

      Returns void

      Nothing.

    • Uses another clip as a mask source for this clip.

      Parameters

      • clip: Clip

        Clip whose sprite should be used as the mask source.

      • Optionaloptions: MaskOptions

        Optional mask behavior.

      Returns undefined | MaskFilter

      The created mask filter, or undefined if the source clip has no sprite.

    • Applies clip, layer, timeline, and fade multipliers to the underlying audio element volume.

      Returns void

      Nothing.

    • Removes all custom metadata stored on the clip.

      Returns void

      Nothing.

    • Creates a cloned audio clip instance from serialized data.

      Returns AudioClip

      A cloned audio clip.

    • Releases clip-owned runtime resources, masks, transitions, effects, and cached lookup state.

      Returns void

      Nothing.

    • Clears any queued media actions waiting to run on the audio element.

      Returns void

      Nothing.

    • Parameters

      • startTime: number
      • endTime: number

      Returns Promise<null | Float32Array<ArrayBufferLike>>

      Use getAudioSamples instead, don't forget to enable them in the settings

    • Generates a new clip ID and updates dependent runtime objects that store that ID.

      Returns void

      Nothing.

    • Returns a copy of all custom metadata stored on the clip.

      Returns undefined | Map<string, unknown>

      A copied metadata map, or undefined if no custom data has been stored.

    • Parameters

      • property: string

      Returns string | number

    • Returns decoded audio samples from the underlying media asset.

      Parameters

      • startTime: number

        Start time in seconds, relative to the source media.

      • Optionalduration: number

        Optional duration in seconds to extract.

      Returns null | Float32Array<ArrayBufferLike>[]

      The audio sample channels, or null if the media data is unavailable.

    • Returns a stored metadata value for the clip.

      Parameters

      • key: string

        Metadata key to look up.

      Returns unknown

      The stored value, or undefined if the key is not present.

    • Returns the full clip duration before trims are applied.

      Returns number

      The clip duration in seconds.

    • Returns the effects currently attached to the clip.

      Returns Effect[]

      The clip effects.

    • Returns the clip end time in timeline space.

      Returns number

      The clip end time in seconds.

    • Returns the filters currently attached to the clip.

      Returns Filter[]

      The clip filters.

    • Returns the clip ID.

      Returns string

      The clip ID.

    • Indicates whether the clip is currently part of any transition.

      Returns boolean

      true if the clip is inside an incoming or outgoing transition; otherwise false.

    • Indicates whether the clip is currently processing a queued play, pause, or seek operation.

      Returns boolean

      true if an asynchronous media action is still in progress; otherwise false.

    • Returns the ID of the layer that currently owns the clip.

      Returns string

      The owning layer ID.

    • Returns the first visible playback time of the clip after left trim is applied.

      Returns number

      The left playback bound in seconds.

    • Returns the amount trimmed from the left edge of the clip.

      Returns number

      Left trim in seconds.

    • Returns the media asset ID currently bound to the clip.

      Returns undefined | string

      The media asset ID, or undefined for clips without media.

    • Returns the user-visible clip name.

      Returns string

      The clip name.

    • Indicates whether pitch preservation is enabled during speed changes.

      Returns boolean

      true if pitch preservation is enabled; otherwise false.

    • Returns the playback speed multiplier.

      Returns number

      The playback speed multiplier.

    • Returns the final visible playback time of the clip after right trim is applied.

      Returns number

      The right playback bound in seconds.

    • Returns the amount trimmed from the right edge of the clip.

      Returns number

      Right trim in seconds.

    • Returns the clip start time in timeline space.

      Returns number

      The clip start time in seconds.

    • Returns the subtitles asset ID currently assigned to the clip.

      Returns undefined | string

      The subtitles asset ID, or undefined if none is assigned.

    • Returns the stored subtitles offset for the clip.

      Returns number

      The subtitles offset in seconds.

    • Returns the incoming transition ID associated with the clip.

      Returns null | string

      The incoming transition ID, or null if none is set.

    • Returns the outgoing transition ID associated with the clip.

      Returns null | string

      The outgoing transition ID, or null if none is set.

    • Returns the playable duration after both trims are applied.

      Returns number

      The trimmed duration in seconds.

    • Returns the clip type identifier.

      Returns string

      The clip type.

    • Indicates whether the clip is marked as visible.

      Returns boolean

      true if the clip is renderable; otherwise false.

    • Returns the clip volume multiplier.

      Returns number

      The clip volume multiplier.

    • Returns the fade curve used for the clip fade-in.

      Returns FadeCurveEnum

      The configured fade-in curve.

    • Returns the configured fade-in duration.

      Returns number

      The fade-in duration in seconds.

    • Returns the fade curve used for the clip fade-out.

      Returns FadeCurveEnum

      The configured fade-out curve.

    • Returns the configured fade-out duration.

      Returns number

      The fade-out duration in seconds.

    • Indicates whether the clip has a stored metadata value for the provided key.

      Parameters

      • key: string

        Metadata key to test.

      Returns boolean

      true if the key exists; otherwise false.

    • Indicates whether the clip has a non-empty user-visible name.

      Returns boolean

      true if a name is set; otherwise false.

    • Indicates that audio clips do not expose a renderable PIXI sprite.

      Returns boolean

      false.

    • Tests whether a screen-space point falls inside the clip's local bounds.

      Parameters

      • point: { cursorX: number; cursorY: number }

        Screen-space cursor coordinates.

      • OptionalignoreVisibility: boolean

        When true, performs the hit test even if the sprite is not currently visible.

      Returns boolean

      true if the point hits the clip; otherwise false.

    • Creates the backing audio element, binds media data, and initializes runtime playback state.

      Parameters

      • layerId: string

        Layer ID that owns this clip.

      Returns Promise<void>

      A promise that resolves after initialization completes.

    • Indicates whether the clip is active on the specified timeline frame.

      Parameters

      • currentTime: number

        Timeline time in seconds.

      Returns boolean

      true if the current frame falls within the clip playback bounds; otherwise false.

    • Indicates whether the clip is muted.

      Returns boolean

      true if the clip is muted; otherwise false.

    • Indicates whether the backing audio element has loaded enough data to seek and play.

      Returns boolean

      true if the audio element is ready; otherwise false.

    • Moves the clip forward or backward on the timeline by the provided offset.

      Parameters

      • amount: number

        Time delta in seconds.

      Returns void

      Nothing.

    • Pauses audio playback and seeks the audio element back to the requested timeline time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns Promise<void>

      A promise that resolves after pause handling completes.

    • Primes the clip for timeline playback and seeks the audio element to the requested time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns Promise<void>

      A promise that resolves after playback pre-roll work completes.

    • Parameters

      • canceled: boolean

      Returns Promise<void>

    • Parameters

      • width: number
      • height: number

      Returns Promise<void>

    • Parameters

      • currentTime: number

        The current time of the timeline

      Returns void

      This is called after all the clips have been rendered in the preview, useful if you want to change some other clip states after rendering

    • Preloads the audio element by seeking it near the requested timeline time.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns void

      Nothing.

    • Runs the next queued audio element action, if any.

      Returns void

      Nothing.

    • Removes a previously attached clip mask.

      Parameters

      • clip: Clip

        Mask source clip to detach.

      Returns void

      Nothing.

    • Parameters

      • id: string

      Returns void

    • Parameters

      • id: string

      Returns void

    • Removes any subtitles association from the clip.

      Returns void

      Nothing.

    • Parameters

      • currentTime: number

      Returns void

    • Resets every animated clip property back to its non-animated base value.

      Returns void

      Nothing.

    • Resets a single animated property back to its base clip/style value.

      Parameters

      • property: string

        Registered animation property key.

      Returns void

      Nothing.

    • Serializes the audio clip.

      Returns {
          animationController?: {
              animationDataIn?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationDataLoop?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string
                          | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationDataOut?: {
                  amplification?: number;
                  inOutOfRange: OutOfRangeEnum;
                  name: string;
                  offset?: number;
                  outOutOfRange: OutOfRangeEnum;
                  propertyAnimations: {
                      inOutOfRange: OutOfRangeEnum;
                      keyframes: {
                          easing: EasingEnum;
                          relativeProperty?: string;
                          space: AnimationSpaceEnum;
                          time: number;
                          value: string
                          | number;
                      }[];
                      outOutOfRange: OutOfRangeEnum;
                      property: string;
                  }[];
                  speed?: number;
              };
              animationInDuration: number;
              animationLoopCount: number;
              animationOutDuration: number;
              loopSmoothing: number;
          };
          blendMode?: NORMAL
          | ADD
          | SCREEN
          | MULTIPLY;
          clipMasks?: { clipId: string; id: string; wrapMode: MaskWrapModeEnum }[];
          customData?: [string, unknown][];
          duration: number;
          effects: any[];
          filters: {
              clipId?: string;
              filterId: string;
              id: string;
              intensity: number;
              provider: string;
          }[];
          id: string;
          isVisible: boolean;
          leftTrim: number;
          mediaDataId: string;
          muted?: boolean;
          name?: string;
          perservePitch: boolean;
          playbackSpeed: number;
          propertyAnimator?: {
              initialValues?: [string, string | number | boolean | number[]][];
              tracks: {
                  customData?: [string, unknown][];
                  defaults?: {
                      handleIn?: { time: number; value: number };
                      handleOut?: { time: number; value: number };
                      hold?: boolean;
                  };
                  keyframes: {
                      handleIn: { time: number; value: number };
                      handleOut: { time: number; value: number };
                      hold?: boolean;
                      time: number;
                      value: (string | number | boolean | number[]) & (
                          undefined
                          | string
                          | number
                          | boolean
                          | number[]
                      );
                  }[];
                  property: string;
                  type: PropertyDescriptionTypeEnum;
              }[];
          };
          rightTrim: number;
          startTime: number;
          style?: unknown;
          subtitlesId?: string;
          subtitlesOffset: number;
          text?: string;
          type: string;
          volume?: number;
          volumeFadeInCurve: FadeCurveEnum;
          volumeFadeInDuration: number;
          volumeFadeOutCurve: FadeCurveEnum;
          volumeFadeOutDuration: number;
          wrapMode?: CLAMP
          | REPEAT
          | PING_PONG
          | EMPTY;
      }

      The serialized audio clip payload.

    • Replaces all custom clip metadata with a copy of the provided map.

      Parameters

      • data: Map<string, unknown>

        Metadata entries to store.

      Returns void

      Nothing.

    • Applies a single animated property value to the clip runtime state.

      Parameters

      • property: string

        Registered animation property key.

      • value: any

        Value to apply.

      Returns void

      Nothing.

    • Sets the clip blend mode and applies the matching PIXI blend mode.

      Parameters

      Returns void

      Nothing.

    • Stores arbitrary metadata on the clip.

      Parameters

      • key: string

        Metadata key.

      • value: unknown

        Metadata value.

      • overwrite: boolean = true

        Whether an existing key may be overwritten.

      Returns boolean

      true if the value was stored; otherwise false when overwrite is disabled and the key already exists.

    • Marks whether the clip is currently inside an incoming transition.

      Parameters

      • insideTransition: boolean

        Whether the clip participates in an incoming transition.

      Returns void

      Nothing.

    • Marks whether the clip is currently inside an outgoing transition.

      Parameters

      • insideTransition: boolean

        Whether the clip participates in an outgoing transition.

      Returns void

      Nothing.

    • Updates the owning layer ID tracked by the clip.

      Parameters

      • layerId: string

        Owning layer ID.

      Returns void

      Nothing.

    • Parameters

      • trim: number

      Returns void

    • Mutes or unmutes the clip.

      Parameters

      • muted: boolean

        Whether the clip should be muted.

      Returns void

      Nothing.

    • Sets the user-visible clip name.

      Parameters

      • name: string

        Name to assign.

      Returns void

      Nothing.

    • Sets whether pitch correction should be preserved while changing playback speed.

      Parameters

      • perservePitch: boolean

        Whether pitch should be preserved.

      Returns void

      Nothing.

    • Changes audio playback speed and updates duration and trims to preserve the requested timing behavior.

      Parameters

      • speed: number

        Playback speed multiplier.

      • perserveLeftBound: boolean = true

        When true, keeps the audible left edge fixed in timeline space.

      • perserveTrimmedDuration: boolean = false

        When true, preserves the trimmed audible duration after the speed change.

      Returns void

      Nothing.

    • Parameters

      • trim: number

      Returns void

    • Parameters

      • startTime: number

      Returns void

    • Associates a subtitles asset with the clip and stores its playback offset.

      Parameters

      • subtitlesId: string

        Subtitles asset ID to attach.

      • offset: number = 0

        Global subtitles offset in seconds.

      Returns void

      Nothing.

    • Replaces the subtitles asset ID assigned to the clip without changing the stored offset.

      Parameters

      • subtitlesId: string

        Subtitles asset ID to assign.

      Returns void

      Nothing.

    • Sets the stored subtitles offset for the clip.

      Parameters

      • offset: number

        Subtitles offset in seconds.

      Returns void

      Nothing.

    • Sets the incoming transition ID currently associated with the clip.

      Parameters

      • transitionId: null | string

        Incoming transition ID, or null to clear it.

      Returns void

      Nothing.

    • Sets the outgoing transition ID currently associated with the clip.

      Parameters

      • transitionId: null | string

        Outgoing transition ID, or null to clear it.

      Returns void

      Nothing.

    • Sets whether the clip sprite is renderable.

      Parameters

      • visible: boolean

        Whether the clip should render.

      Returns void

      Nothing.

    • Sets the clip volume multiplier.

      Parameters

      • volume: number

        Clip volume multiplier.

      Returns void

      Nothing.

    • Sets the interpolation curve used for the clip fade-in.

      Parameters

      Returns void

      Nothing.

    • Sets the audible fade-in duration at the start of the clip.

      Parameters

      • duration: number

        Fade-in duration in seconds.

      Returns void

      Nothing.

    • Sets the interpolation curve used for the clip fade-out.

      Parameters

      Returns void

      Nothing.

    • Sets the audible fade-out duration at the end of the clip.

      Parameters

      • duration: number

        Fade-out duration in seconds.

      Returns void

      Nothing.

    • Synchronizes audio playback state with the timeline playhead.

      Parameters

      • currentTime: number

        Current timeline time in seconds.

      Returns void

      Nothing.

    • Rebinds the clip to updated audio media and refreshes derived timing and playback state.

      Parameters

      • OptionalnewMediaId: string

        Optional replacement media asset ID.

      • Optional_: ReplaceMediaOptions

        Unused replacement options placeholder kept for signature compatibility.

      Returns Promise<boolean>

      A promise that resolves to true if the media update succeeds; otherwise false.

    • Parameters

      • currentTime: number

      Returns void

    • Creates an audio clip instance from serialized data.

      Parameters

      • payload: object

        Serialized audio clip payload.

      Returns AudioClip

      The deserialized audio clip.