Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
d7c6c6c6
Commit
d7c6c6c6
authored
Nov 27, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:Agent应用音色对系统环境语言匹配
parent
4dbdd27c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
MatchLangEnum.java
src/main/java/cn/com/poc/timbre/constants/MatchLangEnum.java
+46
-0
BizVoiceTimbreConvert.java
...java/cn/com/poc/timbre/convert/BizVoiceTimbreConvert.java
+4
-0
GetTimbreDto.java
src/main/java/cn/com/poc/timbre/dto/GetTimbreDto.java
+13
-0
No files found.
src/main/java/cn/com/poc/timbre/constants/MatchLangEnum.java
0 → 100644
View file @
d7c6c6c6
package
cn
.
com
.
poc
.
timbre
.
constants
;
/**
* 系统环境语言匹配
* @deprecated
* 作用在AgentApplication应用的音色配置
* 获取当前系统环境语言,匹配对应的音色类型
* 例如:
* 1.系统环境语言为简体,则匹配音色类型为【中文】,matchLang="zh-CN"
* 2.系统环境语言为繁体,则匹配音色类型为【粤语】,matchLang="zh-HK"
* 3.系统环境语言为英语,则匹配音色类型为【英文】,matchLang="en"
*
* @author alex.yao
*/
public
enum
MatchLangEnum
{
zh_CN
(
0
,
"zh-CN"
),
zh_HK
(
1
,
"zh-HK"
),
en
(
2
,
"en"
);
private
int
language
;
private
String
matchLang
;
MatchLangEnum
(
int
language
,
String
matchLang
)
{
this
.
language
=
language
;
this
.
matchLang
=
matchLang
;
}
public
int
getLanguage
()
{
return
language
;
}
public
String
getMatchLang
()
{
return
matchLang
;
}
public
String
getMatchLangByLanguage
(
int
language
)
{
for
(
MatchLangEnum
matchLang
:
MatchLangEnum
.
values
())
{
if
(
matchLang
.
language
==
language
)
{
return
matchLang
.
matchLang
;
}
}
return
null
;
}
}
src/main/java/cn/com/poc/timbre/convert/BizVoiceTimbreConvert.java
View file @
d7c6c6c6
package
cn
.
com
.
poc
.
timbre
.
convert
;
import
cn.com.poc.timbre.constants.MatchLangEnum
;
import
cn.com.poc.timbre.dto.GetTimbreDto
;
import
cn.com.poc.timbre.dto.TimbreInfo
;
import
cn.com.poc.timbre.entity.BizVoiceTimbreEntity
;
...
...
@@ -72,17 +73,20 @@ public class BizVoiceTimbreConvert {
List
<
TimbreInfo
>
cnTimbreInfos
=
new
ArrayList
<>();
GetTimbreDto
cnDto
=
new
GetTimbreDto
();
cnDto
.
setLanguage
(
0
);
cnDto
.
setMatchLang
(
MatchLangEnum
.
zh_CN
.
getMatchLang
());
cnDto
.
setTimbreInfo
(
cnTimbreInfos
);
List
<
TimbreInfo
>
cantonTimbreInfos
=
new
ArrayList
<>();
GetTimbreDto
cantonDto
=
new
GetTimbreDto
();
cantonDto
.
setLanguage
(
1
);
cantonDto
.
setMatchLang
(
MatchLangEnum
.
zh_HK
.
getMatchLang
());
cantonDto
.
setTimbreInfo
(
cantonTimbreInfos
);
List
<
TimbreInfo
>
enTimbreInfos
=
new
ArrayList
<>();
GetTimbreDto
enDto
=
new
GetTimbreDto
();
enDto
.
setLanguage
(
2
);
enDto
.
setMatchLang
(
MatchLangEnum
.
en
.
getMatchLang
());
enDto
.
setTimbreInfo
(
enTimbreInfos
);
for
(
BizVoiceTimbreEntity
entity
:
entities
)
{
Integer
language
=
entity
.
getLanguage
();
...
...
src/main/java/cn/com/poc/timbre/dto/GetTimbreDto.java
View file @
d7c6c6c6
...
...
@@ -9,11 +9,24 @@ public class GetTimbreDto {
*/
private
Integer
language
;
/**
* 匹配
*/
private
String
matchLang
;
/**
* 音色信息
*/
private
List
<
TimbreInfo
>
timbreInfo
;
public
String
getMatchLang
()
{
return
matchLang
;
}
public
void
setMatchLang
(
String
matchLang
)
{
this
.
matchLang
=
matchLang
;
}
public
Integer
getLanguage
()
{
return
language
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment