Skip to content

Commit 5e5ee3a

Browse files
authored
Merge c67827e into 20bdb39
2 parents 20bdb39 + c67827e commit 5e5ee3a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

source/synthDrivers/sapi5.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import nvwave
1818
from logHandler import log
1919
import weakref
20+
import languageHandler
2021

2122
from speech.commands import (
2223
IndexCommand,
@@ -338,6 +339,18 @@ def outputTags():
338339
log.debugWarning("Couldn't convert character in IPA string: %s" % item.ipa)
339340
if item.text:
340341
textList.append(item.text)
342+
elif isinstance(item, LangChangeCommand):
343+
lcid = languageHandler.LCID_NONE
344+
if item.lang:
345+
lcid = languageHandler.localeNameToWindowsLCID(item.lang)
346+
if lcid == languageHandler.LCID_NONE:
347+
try:
348+
del tags["lang"]
349+
except KeyError:
350+
pass
351+
else:
352+
tags["lang"] = {"langid": "%x" % lcid}
353+
tagsChanged[0] = True
341354
elif isinstance(item, SpeechCommand):
342355
log.debugWarning("Unsupported speech command: %s" % item)
343356
else:

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ In order to use this feature, the application volume adjuster needs to be enable
1616
* Added an action in the Add-on Store to retry the installation if the download/installation of an add-on fails. (#17090, @hwf1324)
1717
* It is now possible to specify a mirror URL to use for the Add-on Store. (#14974)
1818
* When decreasing or increasing the font size in LibreOffice Writer using the corresponding keyboard shortcuts, NVDA announces the new font size. (#6915, @michaelweghorn)
19+
* Automatic language switching is now supported when using Microsoft Speech API version 5 (SAPI5) voices. (#17146, @gexgd0419)
1920

2021
### Changes
2122

0 commit comments

Comments
 (0)