TextStudioAudioPlayer
[DisallowMultipleComponent][AddComponentMenu("Text Studio/Events/Audio Player")][HelpURL("https://www.wetzold.com/tools/text-studio")]public sealed class TextStudioAudioPlayer : MonoBehaviourPlays pooled per-glyph and marker-driven audio cues from Text Studio playback events.
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
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
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}