@@ -392,14 +392,6 @@ build instructions.
392392 - [ ` C_UnitAuras.GetUnitAuras(unit [, filter]) ` ] ( #c_unitaurasgetunitaurasunit--filter )
393393 - [ ` C_UnitAuras.GetAuraDispelTypeColor(dispelName) ` ] ( #c_unitaurasgetauradispeltypecolordispelname )
394394
395- - [ VoiceChat] ( #voicechat )
396- - [ ` C_VoiceChat.GetTtsVoices() ` / ` C_VoiceChat.GetRemoteTtsVoices() ` ] ( #c_voicechatgetttsvoices--c_voicechatgetremotettsvoices )
397- - [ ` C_VoiceChat.SpeakText(voiceID, text [, destination, rate, volume]) ` ] ( #c_voicechatspeaktextvoiceid-text--destination-rate-volume )
398- - [ ` C_VoiceChat.StopSpeakingText() ` ] ( #c_voicechatstopspeakingtext )
399- - [ ` C_TTSSettings ` — getters & setters] ( #c_ttssettings--getters--setters )
400- - [ TTS events] ( #tts-events )
401- - [ TTS CVars] ( #tts-cvars )
402-
403395## Account
404396
405397### ` SaveAccount(name, password) ` / ` DeleteAccount(name) ` / ` GetSavedAccounts() ` / ` LoginWithSavedAccount(name) ` — GlueXML only
@@ -9463,122 +9455,3 @@ builds. So the returned value carries the mixin methods
94639455` .r/.g/.b/.a ` fields. Falls back to a plain ` {r,g,b,a} ` table if
94649456` CreateColor ` isn't loaded yet (shouldn't happen — ` !!!ClassicAPI `
94659457loads first thanks to the triple-` ! ` prefix).
9466-
9467- ## VoiceChat
9468-
9469- Backport of modern WoW's text-to-speech surface — the ` C_VoiceChat ` and
9470- ` C_TTSSettings ` namespaces — backed by ** Windows SAPI** (the OS speech
9471- engine). All playback is ** local** (rendered on your own machine);
9472- vanilla 1.12 has no voice-chat transport, so there is nothing "remote" to
9473- transmit synthesized speech into.
9474-
9475- SAPI is created lazily on first use. If SAPI is unavailable (e.g. running
9476- the client under Wine, or a stripped Windows), every call degrades
9477- gracefully: ` GetTtsVoices ` returns an empty table, ` SpeakText ` fires
9478- ` VOICE_CHAT_TTS_PLAYBACK_FAILED ` and does nothing, and the client stays
9479- stable — there is no crash. Install more voices under ** Windows Settings →
9480- Time & Language → Speech** , then call ` C_TTSSettings.RefreshVoices() ` .
9481-
9482- ### ` C_VoiceChat.GetTtsVoices() ` / ` C_VoiceChat.GetRemoteTtsVoices() `
9483-
9484- Return a numerically-indexed array of voice tables — one per SAPI voice
9485- installed on the machine:
9486-
9487- ``` lua
9488- for _ , v in ipairs (C_VoiceChat .GetTtsVoices ()) do
9489- print (v .voiceID , v .name ) -- e.g. 0 "Microsoft David Desktop - English (United States)"
9490- end
9491- ```
9492-
9493- Each entry is ` { voiceID = <0-based index>, name = <display name> } ` . The
9494- ` voiceID ` is the index you pass to ` SpeakText ` and store via
9495- ` C_TTSSettings.SetVoiceOption ` . ` GetRemoteTtsVoices ` is an alias returning
9496- the same local list (kept for API parity — vanilla has no voice chat).
9497- Calling either refreshes the cached voice list and fires
9498- ` VOICE_CHAT_TTS_VOICES_UPDATE ` if it changed.
9499-
9500- ### ` C_VoiceChat.SpeakText(voiceID, text [, destination, rate, volume]) `
9501-
9502- Speaks ` text ` aloud using the SAPI voice at index ` voiceID ` .
9503-
9504- ``` lua
9505- C_VoiceChat .SpeakText (
9506- C_TTSSettings .GetSpeechVoiceID (), -- use the configured voice
9507- UnitName (" target" ) or " no target" )
9508- ```
9509-
9510- - ** ` voiceID ` ** (number, required) — index into ` GetTtsVoices() ` . Note this
9511- is an ** explicit argument** — ` SpeakText ` does * not* read the ` ttsVoice `
9512- cvar itself, matching Blizzard's contract. Pass
9513- ` C_TTSSettings.GetSpeechVoiceID() ` to honor the configured default.
9514- - ** ` text ` ** (string, required) — UTF-8; spoken as-is.
9515- - ** ` destination ` ** (number, optional, default ` 1 ` ) — ` 1 ` =
9516- ` LOCAL_PLAYBACK ` , ` 4 ` = ` QUEUED_LOCAL_PLAYBACK ` . Accepted for parity;
9517- both queue FIFO through SAPI (no app-side queue).
9518- - ** ` rate ` ** (number, optional, default ` 0 ` ) — speech rate, clamped to
9519- ` [-10, 10] ` .
9520- - ** ` volume ` ** (number, optional, default ` 100 ` ) — clamped to ` [0, 100] ` .
9521-
9522- Speech is asynchronous. The call returns immediately and fires
9523- ` VOICE_CHAT_TTS_PLAYBACK_STARTED ` when SAPI begins the utterance and
9524- ` VOICE_CHAT_TTS_PLAYBACK_FINISHED ` when it completes (or
9525- ` ..._PLAYBACK_FAILED ` if the voice/engine is unavailable). Raises a Lua
9526- error if ` voiceID ` isn't a number or ` text ` isn't a string.
9527-
9528- ### ` C_VoiceChat.StopSpeakingText() `
9529-
9530- Stops and purges everything currently playing or queued.
9531-
9532- ### ` C_TTSSettings ` — getters & setters
9533-
9534- The settings store (separate from ` SpeakText ` , which takes its parameters
9535- explicitly). All three values are backed by CVars (see below), so they
9536- ** persist across sessions** and are clamped to valid ranges on write.
9537-
9538- | Function | Returns / effect |
9539- | ---| ---|
9540- | ` C_TTSSettings.GetSpeechRate() ` | configured rate, ` [-10, 10] ` (default ` 0 ` ) |
9541- | ` C_TTSSettings.GetSpeechVolume() ` | configured volume, ` [0, 100] ` (default ` 100 ` ) |
9542- | ` C_TTSSettings.GetSpeechVoiceID() ` | configured voice index (default ` 0 ` ) |
9543- | ` C_TTSSettings.GetVoiceOptionName() ` | display name of the configured voice, or ` "" ` |
9544- | ` C_TTSSettings.SetSpeechRate(rate) ` | set rate (clamped) |
9545- | ` C_TTSSettings.SetSpeechVolume(volume) ` | set volume (clamped) |
9546- | ` C_TTSSettings.SetVoiceOption(voiceID) ` | set the voice by index (clamped to installed count) |
9547- | ` C_TTSSettings.SetVoiceOptionByName(name) ` | set the voice by display name (case-insensitive exact match) |
9548- | ` C_TTSSettings.SetDefaultSettings() ` | reset to voice ` 1 ` (if present, else ` 0 ` ), rate ` 0 ` , volume ` 100 ` |
9549- | ` C_TTSSettings.RefreshVoices() ` | re-enumerate SAPI voices; fires ` VOICE_CHAT_TTS_VOICES_UPDATE ` if the list changed |
9550-
9551- ``` lua
9552- C_TTSSettings .SetVoiceOptionByName (" Microsoft Zira Desktop - English (United States)" )
9553- C_TTSSettings .SetSpeechVolume (150 ) -- clamps to 100
9554- print (C_TTSSettings .GetVoiceOptionName ()) -- "Microsoft Zira Desktop - ..."
9555- ```
9556-
9557- ### TTS events
9558-
9559- Registered like any engine event (` frame:RegisterEvent("VOICE_CHAT_TTS_PLAYBACK_STARTED") ` ).
9560-
9561- | Event | Args |
9562- | ---| ---|
9563- | ` VOICE_CHAT_TTS_PLAYBACK_STARTED ` | ` numConsumers ` (number), ` utteranceID ` (number), ` durationMS ` (number, always ` 0 ` ), ` destination ` (number) |
9564- | ` VOICE_CHAT_TTS_PLAYBACK_FINISHED ` | ` numConsumers ` (number), ` utteranceID ` (number), ` destination ` (number) |
9565- | ` VOICE_CHAT_TTS_PLAYBACK_FAILED ` | ` status ` (string — e.g. ` "EngineAllocationFailed" ` , ` "InternalError" ` ), ` utteranceID ` (number), ` destination ` (number) |
9566- | ` VOICE_CHAT_TTS_VOICES_UPDATE ` | * (none)* — the installed-voice list changed |
9567- | ` VOICE_CHAT_TTS_SPEAK_TEXT_UPDATE ` | reserved for parity; not currently fired |
9568-
9569- ` utteranceID ` correlates the START/FINISHED/FAILED events for a given
9570- ` SpeakText ` call. ` PLAYBACK_FINISHED ` fires only when playback actually
9571- completes, so it's the signal to start the next utterance in a queue.
9572-
9573- ### TTS CVars
9574-
9575- The ` C_TTSSettings ` values are stored as engine CVars, persisted to
9576- ` WTF\Config.wtf ` . You can also read/write them with the standard
9577- ` GetCVar ` /` SetCVar ` (or ` /console set ` ); writes are clamped by the same
9578- validation:
9579-
9580- | CVar | Default | Range | Backing setting |
9581- | ---| ---| ---| ---|
9582- | ` ttsVoice ` | ` 0 ` | ` [0, voiceCount-1] ` | ` GetSpeechVoiceID ` / ` SetVoiceOption ` |
9583- | ` ttsSpeed ` | ` 0 ` | ` [-10, 10] ` | ` GetSpeechRate ` / ` SetSpeechRate ` |
9584- | ` ttsVolume ` | ` 100 ` | ` [0, 100] ` | ` GetSpeechVolume ` / ` SetSpeechVolume ` |
0 commit comments