Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
2a6fd051
Commit
2a6fd051
authored
May 19, 2022
by
helinlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提取阿里云语音识别appKey等参数
parent
38065ee0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
7 deletions
+34
-7
SpeechConfig.java
.../boot/module/jcs/biz/audioToText/entity/SpeechConfig.java
+22
-0
application.properties
...boot-system-jcs/src/main/resources/application.properties
+7
-2
AppNslClient.java
...h/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
+1
-1
SpeechConfig.java
...h/src/main/java/com/yeejoin/amos/speech/SpeechConfig.java
+3
-3
SpeechRecognizer.java
...c/main/java/com/yeejoin/amos/speech/SpeechRecognizer.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/audioToText/entity/SpeechConfig.java
0 → 100644
View file @
2a6fd051
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
audioToText
.
entity
;
import
lombok.Data
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.stereotype.Component
;
@Data
@Component
@ConfigurationProperties
(
prefix
=
"speech-config"
)
public
class
SpeechConfig
implements
InitializingBean
{
public
String
accessKeyId
;
public
String
accessKeySecret
;
public
String
appKey
;
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
com
.
yeejoin
.
amos
.
speech
.
SpeechConfig
.
AccessKeyId
=
accessKeyId
;
com
.
yeejoin
.
amos
.
speech
.
SpeechConfig
.
AccessKeySecret
=
accessKeySecret
;
com
.
yeejoin
.
amos
.
speech
.
SpeechConfig
.
AppKey
=
appKey
;
}
}
amos-boot-system-jcs/src/main/resources/application.properties
View file @
2a6fd051
...
...
@@ -113,4 +113,9 @@ auth-key-fire-fighters=fire_fighters_info
mybatis.interceptor.enabled
=
false
## 消防救援保障部ID
fire-rescue
=
1432549862557130753
\ No newline at end of file
fire-rescue
=
1432549862557130753
#???????????
speech-config.access-key-id
=
LTAI5t7mGN6dYoCwMdKiLTgt
speech-config.access-key-secret
=
0LYdEnvKzQxBg0lpIahDp5rzB2r4Dp
speech-config.app-key
=
EG5fJBBIqkNMj6bM
\ No newline at end of file
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
View file @
2a6fd051
...
...
@@ -85,7 +85,7 @@ class AppNslClientToken {
* @return token 访问token
*/
private
static
AccessToken
getAccessToken
()
{
AccessToken
accessToken
=
new
AccessToken
(
SpeechConfig
.
AccessKeId
,
SpeechConfig
.
AccessKeySecret
);
AccessToken
accessToken
=
new
AccessToken
(
SpeechConfig
.
AccessKe
y
Id
,
SpeechConfig
.
AccessKeySecret
);
try
{
accessToken
.
apply
();
logger
.
warn
(
"获取到最新的token: "
+
accessToken
.
getToken
()
+
", 过期时间: "
+
accessToken
.
getExpireTime
()
+
"("
+
accessToken
.
getExpireTime
()
/
(
1000
*
60
*
60
*
24
)
+
"天)"
);
...
...
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechConfig.java
View file @
2a6fd051
...
...
@@ -23,8 +23,8 @@ public class SpeechConfig {
/**
* 测试信息,可在阿里云上配置
*/
public
static
final
String
AccessKeId
=
"LTAI5t7mGN6dYoCwMdKiLTgt
"
;
public
static
final
String
AccessKeySecret
=
"0LYdEnvKzQxBg0lpIahDp5rzB2r4Dp
"
;
public
static
final
String
AppKey
=
"EG5fJBBIqkNMj6bM
"
;
public
static
String
AccessKeyId
=
"
"
;
public
static
String
AccessKeySecret
=
"
"
;
public
static
String
AppKey
=
"
"
;
}
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/SpeechRecognizer.java
View file @
2a6fd051
...
...
@@ -69,7 +69,7 @@ public class SpeechRecognizer {
e
.
printStackTrace
();
}
// 创建DefaultAcsClient实例并初始化
DefaultProfile
profile
=
DefaultProfile
.
getProfile
(
REGIONID
,
SpeechConfig
.
AccessKeId
,
SpeechConfig
.
AccessKeySecret
);
DefaultProfile
profile
=
DefaultProfile
.
getProfile
(
REGIONID
,
SpeechConfig
.
AccessKe
y
Id
,
SpeechConfig
.
AccessKeySecret
);
this
.
client
=
new
DefaultAcsClient
(
profile
);
}
...
...
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