Skip to content

Commit 9847e32

Browse files
committed
配置中加入语言配置,zh-CN中文,en-US英文(只有在SpeakVoice配置有空才有效,否则优先选择SpeakVoice语音包)
增加unity工程运行时界面的文字输入框,输入后,再点击speak按钮可以发出对应的语音,注意如果使用英文语音,但是输入的是中文,将不会有任何反应
1 parent 60f70cc commit 9847e32

File tree

16 files changed

+75
-13
lines changed

16 files changed

+75
-13
lines changed

SApiClient/Assets/Sapi/SpeecherManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal void Awake()
1111

1212
/***测试代码,可删除Start***/
1313

14+
private string m_msg = "Hello World";
1415
public virtual void OnGUI()
1516
{
1617
if (GUILayout.Button("Connect"))
@@ -22,9 +23,10 @@ public virtual void OnGUI()
2223
StartCoroutine(Speecher.InitServer());
2324
}
2425

26+
m_msg = GUILayout.TextField(m_msg);
2527
if (GUILayout.Button("Speak"))
2628
{
27-
Speecher.Speech("hello world");
29+
Speecher.Speech(m_msg);
2830
}
2931

3032
if (GUILayout.Button("Recognize Start"))

SApiClient/Output/Speech.exe

512 Bytes
Binary file not shown.

SApiClient/Output/Speech.exe.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<value>0</value>
1515
</setting>
1616
<setting name="SpeakVoice" serializeAs="String">
17-
<value>Microsoft Huihui Desktop</value>
17+
<value />
1818
</setting>
1919
<setting name="Port" serializeAs="String">
2020
<value>9903</value>
@@ -28,6 +28,9 @@
2828
</ArrayOfString>
2929
</value>
3030
</setting>
31+
<setting name="DefaultLang" serializeAs="String">
32+
<value>zh-CN</value>
33+
</setting>
3134
</Speech.Properties.Settings>
3235
</userSettings>
3336
</configuration>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

SApiClient/SApiClient.CSharp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
66
<ProductVersion>10.0.20506</ProductVersion>
77
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}</ProjectGuid>
8+
<ProjectGuid>{074B43BF-2FFD-065D-E810-B6D7008482F6}</ProjectGuid>
99
<OutputType>Library</OutputType>
1010
<AssemblyName>Assembly-CSharp</AssemblyName>
1111
<FileAlignment>512</FileAlignment>

SApiClient/SApiClient.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2015
4-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SApiClient.CSharp", "SApiClient.CSharp.csproj", "{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}"
4+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SapiClient.CSharp", "SapiClient.CSharp.csproj", "{074B43BF-2FFD-065D-E810-B6D7008482F6}"
55
EndProject
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speech", "..\Speech\Speech.csproj", "{75C5ABB7-650C-444F-9657-A4A054F67E99}"
77
EndProject
@@ -11,10 +11,10 @@ Global
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{2BE63604-AAAE-6B06-E9A5-D3E354898A9E}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{074B43BF-2FFD-065D-E810-B6D7008482F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{074B43BF-2FFD-065D-E810-B6D7008482F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{074B43BF-2FFD-065D-E810-B6D7008482F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{074B43BF-2FFD-065D-E810-B6D7008482F6}.Release|Any CPU.Build.0 = Release|Any CPU
1818
{75C5ABB7-650C-444F-9657-A4A054F67E99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1919
{75C5ABB7-650C-444F-9657-A4A054F67E99}.Debug|Any CPU.Build.0 = Debug|Any CPU
2020
{75C5ABB7-650C-444F-9657-A4A054F67E99}.Release|Any CPU.ActiveCfg = Release|Any CPU

SApiClient/Speech.exe

512 Bytes
Binary file not shown.

SApiClient/Speech.exe.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<value>0</value>
1515
</setting>
1616
<setting name="SpeakVoice" serializeAs="String">
17-
<value>Microsoft Huihui Desktop</value>
17+
<value />
1818
</setting>
1919
<setting name="Port" serializeAs="String">
2020
<value>9903</value>
@@ -28,6 +28,9 @@
2828
</ArrayOfString>
2929
</value>
3030
</setting>
31+
<setting name="DefaultLang" serializeAs="String">
32+
<value>zh-CN</value>
33+
</setting>
3134
</Speech.Properties.Settings>
3235
</userSettings>
3336
</configuration>

0 commit comments

Comments
 (0)