Removed python implementation
parent
0492ade55b
commit
0c6671a4f9
|
@ -0,0 +1 @@
|
|||
libspeechd.so.2.6.0
|
|
@ -0,0 +1 @@
|
|||
libspeechd.so.2.6.0
|
Binary file not shown.
|
@ -1,9 +0,0 @@
|
|||
import wrapper
|
||||
|
||||
speech = wrapper.Speech
|
||||
|
||||
speech.Initialize(self=speech)
|
||||
|
||||
speech.Say(self=speech, text="hello", interrupt=False)
|
||||
|
||||
speech.Close(self=speech)
|
|
@ -1,14 +0,0 @@
|
|||
import wrapper
|
||||
import time
|
||||
|
||||
speech = wrapper.Speech
|
||||
|
||||
speech.Initialize(self=speech)
|
||||
|
||||
speech.Say(self=speech, text="This is a very very very long string.", interrupt=False)
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
speech.Say(self=speech, text="I interrupted :)", interrupt=True)
|
||||
|
||||
speech.Close(self=speech)
|
|
@ -1,17 +0,0 @@
|
|||
# Copyright (C) 2001, 2002 Brailcom, o.p.s.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; either version 2.1 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
from .client import *
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
SPD_SPAWN_CMD = "/usr/local/bin/speech-dispatcher"
|
|
@ -1,18 +0,0 @@
|
|||
import speechd
|
||||
|
||||
class Speech:
|
||||
client = None
|
||||
|
||||
def Initialize(self):
|
||||
self.client = speechd.SSIPClient('stardew-access')
|
||||
|
||||
def Say(self, text, interrupt):
|
||||
if(self.client is not None):
|
||||
if(interrupt):
|
||||
self.client.stop()
|
||||
|
||||
self.client.speak(text)
|
||||
|
||||
def Close(self):
|
||||
if(self.client is not None):
|
||||
self.client.close()
|
|
@ -8,32 +8,11 @@ namespace stardew_access
|
|||
public class ScreenReader
|
||||
{
|
||||
public IAccessibleOutput? screenReader = null;
|
||||
public dynamic wrapperInstance = null;
|
||||
public string prevText = "", prevTextTile = " ", prevChatText = "", prevMenuText = "";
|
||||
|
||||
/// <summary>Initializes the screen reader.</summary>
|
||||
public void InitializeScreenReader()
|
||||
{
|
||||
MainClass.monitor.Log($"here! {RuntimeInformation.OSDescription}", LogLevel.Debug);
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
MainClass.monitor.Log($"here!", LogLevel.Debug);
|
||||
//instance of python engine
|
||||
var engine = Python.CreateEngine();
|
||||
//reading code from file
|
||||
var source = engine.CreateScriptSourceFromFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "LinuxSpeech", "wrapper.py"));
|
||||
var scope = engine.CreateScope();
|
||||
//executing script in scope
|
||||
source.Execute(scope);
|
||||
var wrapper = scope.GetVariable("Speech");
|
||||
//initializing class
|
||||
wrapperInstance = engine.Operations.CreateInstance(wrapper);
|
||||
wrapperInstance.Initialize();
|
||||
|
||||
MainClass.monitor.Log($"here!", LogLevel.Debug);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return;
|
||||
|
@ -78,12 +57,6 @@ namespace stardew_access
|
|||
/// <param name="interrupt">Whether to skip the currently speaking text or not.</param>
|
||||
public void Say(string text, bool interrupt)
|
||||
{
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
wrapperInstance.Say(text, interrupt);
|
||||
return;
|
||||
}
|
||||
|
||||
if (screenReader == null)
|
||||
return;
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in New Issue