Skip to content
Roblox API Reference

AudioPlayer

Used to play audio assets.
Memory category
Internal
Own members
26
Inherited members
75
Subclasses
0
Siblings
608

Properties38

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byAudioPlayer15

Property categoryAsset

  • AudioPlayer.Asset: string = ""
    The asset to be loaded into the AudioPlayer.
    • Read capabilities: Audio
  • AudioPlayer.AudioContent: Content
    The audio content to be loaded into the AudioPlayer.
    • Read capabilities: Audio
  • AudioPlayer.AutoLoad: boolean = true
    Controls whether Asset loads automatically once assigned.
    • Read capabilities: Audio
  • AudioPlayer.IsReady: boolean = false
    Denotes whether this AudioPlayer is loaded, buffered, and ready to play.
    • Read only
    • Read capabilities: Audio
    • Save only
  • AudioPlayer.TimeLength: number = 0
    Denotes the length of the loaded asset.
    • Read only
    • Read capabilities: Audio
    • Save only
  • AudioPlayer.AssetId: string = ""
    Deprecated: This property is deprecated; use Asset instead.
    The asset to be loaded into the AudioPlayer.
    • Deprecated
    • Hidden
    • Not replicated
    • Read capabilities: Audio
    • Load only

    Use Asset instead.

Property categoryBehavior

Property categoryPlayback

  • AudioPlayer.AutoPlay: boolean = false
    Denotes whether this AudioPlayer starts playing as soon as it spawns in for the first time.
    • Read capabilities: Audio
  • AudioPlayer.IsPlaying: boolean = false
    Denotes whether this AudioPlayer is currently playing or planning to play.
    • Write: Roblox engine security
    • Read capabilities: Audio
  • AudioPlayer.Looping: boolean = false
    Controls whether this AudioPlayer loops.
    • Read capabilities: Audio
  • AudioPlayer.PlaybackSpeed: number = 1
    Controls how quickly the asset will be played, which controls its pitch.
    • Read capabilities: Audio
  • AudioPlayer.TimePosition: number = 0
    Tracks the current position of the playhead within the asset.
    • Read capabilities: Audio

Property categoryRegions

Property categoryState

  • AudioPlayer.Volume: number = 1
    Controls how loudly the asset will be played.
    • Read capabilities: Audio

Methods50

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byAudioPlayer8
  • AudioPlayer:Cancel(actionId: number?): boolean
    Attempts to cancel a pre-planned future Play or Stop command.
    • Capabilities: Audio
    Parameters
    ParameterDescription
    actionId: number?
    The unique-ID of a pre-planned Play or Stop command.
    Returns
    TypeDescription
    boolean
    Whether the cancellation was successful. Returns false if the action has already occurred, or otherwise does not exist.
  • AudioPlayer:GetConnectedWires(pin: string): { Instance }
    Returns an array of Wires that are connected to the specified pin.
    • Capabilities: Audio
    Parameters
    ParameterDescription
    pin: string
    An input or output pin on this instance
    Returns
    TypeDescription
    { Instance }
    An array of Wires
  • AudioPlayer:GetInputPins(): { any }
    Gets the list of pins that Wire can use in Wire.TargetName to connect to this instance via its Wire.TargetInstance property.
    • Capabilities: Audio
    Returns
    TypeDescription
    { any }
    An array of strings representing valid pin names.
  • AudioPlayer:GetOutputPins(): { any }
    Gets the list of pins that Wire can use in Wire.SourceName to connect to this instance via its Wire.SourceInstance property.
    • Capabilities: Audio
    Returns
    TypeDescription
    { any }
    An array of strings representing valid pin names.
  • AudioPlayer:GetPlaybackState(): string
    • Roblox script security
    • Capabilities: Audio
    Returns
    Type
    string
  • AudioPlayer:GetWaveformAsync(timeRange: NumberRange, samples: number): { any }
    Returns a sampling of the waveform data for the loaded Asset.
    • Yields
    • Capabilities: Audio
    Parameters
    ParameterDescription
    timeRange: NumberRange
    The start and end time (in seconds) of the segment to read.
    samples: number
    The number of samples to return for the specified range.
    Returns
    TypeDescription
    { any }
    A table of samples numbers ranging between -1 and 1 representing the sampled waveform, or an empty table if a waveform could not be read.
  • AudioPlayer:Play(atTime: number?): number?
    Plays the AudioPlayer from wherever its TimePosition is.
    • Capabilities: Audio
    Parameters
    ParameterDescription
    atTime: number?
    A specific time, based on GetMixerTime, that this AudioPlayer should begin playing at.
    Returns
    TypeDescription
    number?
    If atTime was provided, a unique ID, which can be passed to Cancel().
  • AudioPlayer:Stop(atTime: number?): number?
    Stops the AudioPlayer wherever its TimePosition is.
    • Capabilities: Audio
    Parameters
    ParameterDescription
    atTime: number?
    A specific time, based on GetMixerTime, that this AudioPlayer should stop playing at.
    Returns
    TypeDescription
    number?
    If atTime was provided, a unique ID, which can be passed to Cancel().

Events13

Inherited fromObject1
Inherited fromInstance9
Defined byAudioPlayer3