This commit is contained in:
BoHung Chiu 2022-10-25 10:58:32 +08:00
parent b7d7b6e9ae
commit 76646d0b43
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ module RuCaptcha
require 'fileutils'
EspeakDataDir = "#{ENV['HOME']}/espeak-ng-data"
EspeakBuildDir = "#{ENV['HOME']}/.espeak_build"
EspeakLibDir = "#{ENV['HOME']}/shared_library"
EspeakLibDir = "#{ENV['HOME']}/.espeak_build/shared_library"
unless Dir.exist?(EspeakDataDir)
FileUtils.cp_r(File.expand_path("../../../resources/espeak-ng-data", __FILE__), EspeakDataDir)
end
@ -79,7 +79,7 @@ module RuCaptcha
cmd << " -g #{gap}" unless @gap.nil?
cmd << " -v '#{voice}'" unless @voice.nil?
cmd << " -w #{wav_file} ' #{code}'"
system({'LD_LIBRARY_PATH'=>"#{ENV['HOME']}/.espeak_build/shared_library"}, cmd)
system({'LD_LIBRARY_PATH'=>EspeakLibDir}, cmd)
true
end