TextStudioAudioPlayer
public sealed class TextStudioAudioPlayer : MonoBehaviourPlays pooled Audio Set cues from Typewriter events, Reactions, or explicit callers.
Fields
Section titled “Fields”
GlyphCueRoute
Section titled “GlyphCueRoute”public const string GlyphCueRoute = "typewriter.glyph"Returns
System.String
Methods
Section titled “Methods”
SetClips(params AudioClip[])
Section titled “SetClips(params AudioClip[])”public void SetClips(params AudioClip[] clips)Replaces inline glyph clips, removing null entries.
Parameters
| Name | Type |
|---|---|
clips |
UnityEngine.AudioClip[] |
AddMarkerCue(string, params AudioClip[])
Section titled “AddMarkerCue(string, params AudioClip[])”public TextStudioAudioPlayerMarkerCue AddMarkerCue(string routeId, params AudioClip[] clips)Adds an inline marker route with a cleaned clip set and returns it for further configuration.
Parameters
| Name | Type |
|---|---|
routeId |
System.String |
clips |
UnityEngine.AudioClip[] |
Returns
TextStudio.TextStudioAudioPlayerMarkerCue
PrewarmPool()
Section titled “PrewarmPool()”public void PrewarmPool()Creates the configured number of reusable AudioSource instances.
TryPlayCharacterCue(char)
Section titled “TryPlayCharacterCue(char)”public bool TryPlayCharacterCue(char character)Applies character eligibility and cooldown rules, then plays a glyph cue when possible.
Parameters
| Name | Type |
|---|---|
character |
System.Char |
Returns
System.Boolean
TryPlayMarkerCue(string, string[])
Section titled “TryPlayMarkerCue(string, string[])”public bool TryPlayMarkerCue(string markerId, string[] parameters)Resolves an authored marker route and plays a matching configured cue.
Parameters
| Name | Type |
|---|---|
markerId |
System.String |
parameters |
System.String[] |
Returns
System.Boolean
TryPlayReactionCue(string, float)
Section titled “TryPlayReactionCue(string, float)”public bool TryPlayReactionCue(string cueId, float intensity = 1)Plays the Audio Set marker cue whose route matches a reaction’s Audio Cue field.
Parameters
| Name | Type |
|---|---|
cueId |
System.String |
intensity |
System.Single |
Returns
System.Boolean
TryPlayReactionCue(ITextStudioReactionUnitTextSource, in TextStudioReactionContext)
Section titled “TryPlayReactionCue(ITextStudioReactionUnitTextSource, in TextStudioReactionContext)”public bool TryPlayReactionCue(ITextStudioReactionUnitTextSource source, in TextStudioReactionContext context)Plays a cue from a component or UI Toolkit Reaction using this player’s clips and pool.
Parameters
| Name | Type |
|---|---|
source |
TextStudio.ITextStudioReactionUnitTextSource |
context |
TextStudio.TextStudioReactionContext |
Returns
System.Boolean
StopPlayback()
Section titled “StopPlayback()”public void StopPlayback()Stops current voices and returns them to the reusable pool without disabling future event delivery.
Constructors
Section titled “Constructors”
TextStudioAudioPlayer()
Section titled “TextStudioAudioPlayer()”public TextStudioAudioPlayer()Properties
Section titled “Properties”
Target
Section titled “Target”public TextStudioText Target { get; set; }Returns
TextStudio.TextStudioText
CueTrigger
Section titled “CueTrigger”public TextStudioAudioPlayerCueTrigger CueTrigger { get; set; }Returns
TextStudio.TextStudioAudioPlayerCueTrigger
SourcePoolSize
Section titled “SourcePoolSize”public int SourcePoolSize { get; set; }Returns
System.Int32
ActiveSourceCount
Section titled “ActiveSourceCount”public int ActiveSourceCount { get; }Returns
System.Int32
PlaybackCount
Section titled “PlaybackCount”public int PlaybackCount { get; }Returns
System.Int32
PlayGlyphCues
Section titled “PlayGlyphCues”public bool PlayGlyphCues { get; set; }Returns
System.Boolean
PlayMarkerCues
Section titled “PlayMarkerCues”public bool PlayMarkerCues { get; set; }Returns
System.Boolean
SettingsSource
Section titled “SettingsSource”public TextStudioAudioPlayerSettingsSource SettingsSource { get; set; }Returns
TextStudio.TextStudioAudioPlayerSettingsSource
AudioSet
Section titled “AudioSet”public TextStudioAudioSet AudioSet { get; set; }Returns
TextStudio.TextStudioAudioSet
SourceTemplate
Section titled “SourceTemplate”public AudioSource SourceTemplate { get; set; }Returns
UnityEngine.AudioSource
ClipSequenceMode
Section titled “ClipSequenceMode”public TextStudioAudioPlayerClipSequenceMode ClipSequenceMode { get; set; }Returns
TextStudio.TextStudioAudioPlayerClipSequenceMode
PlaybackMode
Section titled “PlaybackMode”public TextStudioAudioPlayerPlaybackMode PlaybackMode { get; set; }Returns
TextStudio.TextStudioAudioPlayerPlaybackMode
IgnoreWhitespaceAndPunctuation
Section titled “IgnoreWhitespaceAndPunctuation”public bool IgnoreWhitespaceAndPunctuation { get; set; }Returns
System.Boolean
IgnoredPunctuation
Section titled “IgnoredPunctuation”public string IgnoredPunctuation { get; set; }Returns
System.String
CooldownSeconds
Section titled “CooldownSeconds”public float CooldownSeconds { get; set; }Returns
System.Single
PitchRange
Section titled “PitchRange”public Vector2 PitchRange { get; set; }Returns
UnityEngine.Vector2
Volume
Section titled “Volume”public float Volume { get; set; }Returns
System.Single
MarkerCues
Section titled “MarkerCues”public IReadOnlyList<TextStudioAudioPlayerMarkerCue> MarkerCues { get; }Returns
System.Collections.Generic.IReadOnlyList{TextStudio.TextStudioAudioPlayerMarkerCue}