diff --git a/lib/rucaptcha/espeak.rb b/lib/rucaptcha/espeak.rb index 2af5fac..55adf9f 100644 --- a/lib/rucaptcha/espeak.rb +++ b/lib/rucaptcha/espeak.rb @@ -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