Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion SpeechMod/Voice/WindowsSpeech.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ private string FormatGenderSpecificVoices(string text)

private void SpeakInternal(string text, float delay = 0f)
{
text = SpeakBegin + text + SpeakEnd;
// Send raw SAPI XML (a "<voice .../>" fragment) as-is. Do NOT wrap it in a W3C
// <speak xmlns="http://www.w3.org/2001/10/synthesis"> document: that wrapper makes SAPI
// ignore the proprietary <voice required="Name=..."> selection (so it falls back to the
// system default voice) and makes neural engines such as NaturalVoiceSAPIAdapter reject
// the markup with SPERR_UNSUPPORTED_FORMAT (0x80045003) -> no audio.
if (Main.Settings?.LogVoicedLines == true)
Debug.Log(text);
WindowsVoiceUnity.Speak(text, Length(text), delay);
Expand Down