Skip to content

Commit 00a5baa

Browse files
committed
Store espeak in lib folder
1 parent 83c3a98 commit 00a5baa

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

nvdaHelper/archBuild_sconscript

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,10 @@ if not isNVDAHelperLocalArch:
266266
if signExec:
267267
env.AddPostAction(remoteLoaderProgram, [signExec])
268268
env.Install(libInstallDir, remoteLoaderProgram)
269-
269+
if isNVDAHelperLocalArch:
270+
(espeakLib, sonicLib) = thirdPartyEnv.SConscript("espeak/sconscript")
271+
env.Install(libInstallDir, (espeakLib, sonicLib))
270272
if isNVDACoreArch:
271-
thirdPartyEnv.SConscript("espeak/sconscript")
272273
thirdPartyEnv.SConscript("liblouis/sconscript")
273274

274275
# UWP dlls can only be dynamically linked with the CRT,

nvdaHelper/espeak/sconscript

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,6 @@ for dictFileName, (langCode, inputFiles) in espeakDictionaryCompileList.items():
11621162
os.path.join(synthDriversDir.Dir("espeak-ng-data").abspath, dictFileName), dictFile
11631163
)
11641164

1165-
env.Install(synthDriversDir, espeakLib)
1166-
env.Install(synthDriversDir, sonicLib)
1167-
11681165
# install espeak-ng-data
11691166
targetEspeakDataDir = synthDriversDir.Dir("espeak-ng-data")
11701167
espeakDataSource = espeakRepo.Dir("espeak-ng-data")
@@ -1174,3 +1171,5 @@ env.RecursiveInstall(targetEspeakDataDir.Dir("lang"), espeakDataSource.Dir("lang
11741171
env.RecursiveInstall(
11751172
targetEspeakDataDir.Dir("voices").Dir("!v"), espeakDataSource.Dir("voices").Dir("!v").abspath
11761173
)
1174+
1175+
Return("sonicLib", "espeakLib")

source/synthDrivers/_espeak.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ctypes import * # noqa: F403
1212
import config
1313
import globalVars
14+
import NVDAHelper
1415
from logHandler import log
1516
import os
1617

@@ -356,7 +357,7 @@ def initialize(indexCallback=None):
356357
the number of the index or C{None} when speech stops.
357358
"""
358359
global espeakDLL, bgThread, bgQueue, player, onIndexReached
359-
espeakDLL = cdll.LoadLibrary(os.path.join(globalVars.appDir, "synthDrivers", "espeak.dll"))
360+
espeakDLL = cdll.LoadLibrary(os.path.join(NVDAHelper.coreArchLibPath, "espeak.dll"))
360361
espeakDLL.espeak_Info.restype = c_char_p # noqa: F405
361362
espeakDLL.espeak_Synth.errcheck = espeak_errcheck
362363
espeakDLL.espeak_SetVoiceByName.errcheck = espeak_errcheck

source/synthDrivers/_sonic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from ctypes import CDLL, POINTER, Array, c_float, c_int, c_short, c_ubyte, c_void_p, cdll
77
import os
88
from typing import TYPE_CHECKING
9-
import globalVars
9+
import NVDAHelper
1010
from logHandler import log
1111

1212
if TYPE_CHECKING:
@@ -29,13 +29,12 @@ class SonicStreamP(c_void_p):
2929

3030
def initialize():
3131
"""Initialize the Sonic DLL.
32-
The sonic.dll file should be in the synthDrivers directory.
3332
This can be called more than once."""
3433
global sonicLib
3534
if sonicLib:
3635
return
3736
log.debug("Initializing Sonic library")
38-
sonicLib = cdll.LoadLibrary(os.path.join(globalVars.appDir, "synthDrivers", "sonic.dll"))
37+
sonicLib = cdll.LoadLibrary(os.path.join(NVDAHelper.coreArchLibPath, "sonic.dll"))
3938
sonicLib.sonicCreateStream.restype = SonicStreamP
4039
sonicLib.sonicCreateStream.argtypes = [c_int, c_int]
4140
sonicLib.sonicDestroyStream.restype = None

0 commit comments

Comments
 (0)