Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
aivoice_plugin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
王苏进
aivoice_plugin
Commits
756878a9
提交
756878a9
authored
9月 11, 2024
作者:
王苏进
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: fix
上级
29fa1f76
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
12 行删除
+23
-12
Podfile.lock
example/ios/Podfile.lock
+1
-1
main.dart
example/lib/main.dart
+12
-4
TtsNovel.m
ios/Classes/TtsNovel.m
+10
-7
没有找到文件。
example/ios/Podfile.lock
浏览文件 @
756878a9
...
@@ -36,4 +36,4 @@ SPEC CHECKSUMS:
...
@@ -36,4 +36,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 0212500e480860ee905e9b132693e030f85d651b
PODFILE CHECKSUM: 0212500e480860ee905e9b132693e030f85d651b
COCOAPODS: 1.1
5.2
COCOAPODS: 1.1
4.3
example/lib/main.dart
浏览文件 @
756878a9
...
@@ -33,9 +33,10 @@ class _MyAppState extends State<MyApp> {
...
@@ -33,9 +33,10 @@ class _MyAppState extends State<MyApp> {
initPlatformState
();
initPlatformState
();
_aivoicePlugin
.
onAsrResultReceived
.
listen
((
event
)
{
_aivoicePlugin
.
onAsrResultReceived
.
listen
((
event
)
{
setState
(()
{
final
a
=
event
[
"finish"
];
_text
=
event
[
"text"
];
});
setState
(()
{});
_text
=
"
$a
"
;
// print(event["text"]);
// print(event["text"]);
});
});
_aivoicePlugin
.
prepareEnvironment
({
"appId"
:
"2301072440"
});
_aivoicePlugin
.
prepareEnvironment
({
"appId"
:
"2301072440"
});
...
@@ -84,7 +85,14 @@ class _MyAppState extends State<MyApp> {
...
@@ -84,7 +85,14 @@ class _MyAppState extends State<MyApp> {
onPressed:
()
{
onPressed:
()
{
_aivoicePlugin
.
ttsSynthesis
({});
_aivoicePlugin
.
ttsSynthesis
({});
},
},
child:
const
Text
(
'合成'
))
child:
const
Text
(
'合成'
)),
TextButton
(
onPressed:
()
{
_aivoicePlugin
.
ttsStartEngineBtnClick
(
{
"text"
:
"引擎启动成功,收到该回调后,在单次合成场景下收到该回调时语音合成已经开始,同时数据字段为该次请求的请求 ID; 连续合成场景下还需要再发送合成指令,才真正的开始合成。"
});
_aivoicePlugin
.
ttsSynthesis
({});
},
child:
const
Text
(
'一件开始'
))
// TextButton(
// TextButton(
// onPressed: () {
// onPressed: () {
// _aivoicePlugin.initEngine(configMap);
// _aivoicePlugin.initEngine(configMap);
...
...
ios/Classes/TtsNovel.m
浏览文件 @
756878a9
...
@@ -193,7 +193,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
...
@@ -193,7 +193,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
// // 按装机量授权,不限制 APP 的包名和使用次数,但是限制使用离线合成的设备数量
// // 按装机量授权,不限制 APP 的包名和使用次数,但是限制使用离线合成的设备数量
// //【必需配置】离线合成鉴权相关:Authenticate Address
// //【必需配置】离线合成鉴权相关:Authenticate Address
// [self.curEngine setStringParam:SDEF_AUTHENTICATE_ADDRESS forKey:SE_PARAMS_KEY_AUTHENTICATE_ADDRESS_STRING];
// [self.curEngine setStringParam:SDEF_AUTHENTICATE_ADDRESS forKey:SE_PARAMS_KEY_AUTHENTICATE_ADDRESS_STRING];
// //【必需配置】离
线
合成鉴权相关:Authenticate Uri
// //【必需配置】离
��
合成鉴权相关:Authenticate Uri
// [self.curEngine setStringParam:SDEF_AUTHENTICATE_URI forKey:SE_PARAMS_KEY_AUTHENTICATE_URI_STRING];
// [self.curEngine setStringParam:SDEF_AUTHENTICATE_URI forKey:SE_PARAMS_KEY_AUTHENTICATE_URI_STRING];
// NSString* curBusinessKey = [self.settings getString:SETTING_BUSINESS_KEY];
// NSString* curBusinessKey = [self.settings getString:SETTING_BUSINESS_KEY];
// NSString* curAuthenticateSecret = [self.settings getString:SETTING_AUTHENTICATE_SECRET];
// NSString* curAuthenticateSecret = [self.settings getString:SETTING_AUTHENTICATE_SECRET];
...
@@ -660,7 +660,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
...
@@ -660,7 +660,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
case
SEConnectTimeout
:
case
SEConnectTimeout
:
case
SEReceiveTimeout
:
case
SEReceiveTimeout
:
case
SENetLibError
:
case
SENetLibError
:
// 遇到网络错误时建议重
试
,重试次数不超过 3 次
// 遇到网络错误时建议重
��
,重试次数不超过 3 次
needStop
=
!
[
self
retrySynthesis
];
needStop
=
!
[
self
retrySynthesis
];
if
(
needStop
)
{
if
(
needStop
)
{
self
.
engineErrorOccurred
=
TRUE
;
self
.
engineErrorOccurred
=
TRUE
;
...
@@ -743,7 +743,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
...
@@ -743,7 +743,7 @@ static int TTS_MAX_RETRY_COUNT = 3;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
// self.pauseResumeButton.enabled = TRUE;
// self.pauseResumeButton.enabled = TRUE;
self
.
ttsPlayingProgress
=
0
.
0
;
self
.
ttsPlayingProgress
=
0
.
0
;
//
[self updateTtsResultText:playingId];
[
self
updateTtsResultText
:
playingId
];
});
});
}
}
...
@@ -777,13 +777,19 @@ static int TTS_MAX_RETRY_COUNT = 3;
...
@@ -777,13 +777,19 @@ static int TTS_MAX_RETRY_COUNT = 3;
// if (![self.settings getBool:SETTING_TTS_ENABLE_DUMP_NOVEL_TTS_DETAIL]) {
// if (![self.settings getBool:SETTING_TTS_ENABLE_DUMP_NOVEL_TTS_DETAIL]) {
// [self.ttsSynthesisMap removeObjectForKey:playingId];
// [self.ttsSynthesisMap removeObjectForKey:playingId];
// }
// }
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
ttsPlayingProgress
=
1
.
0
;
self
.
ttsPlayingProgress
=
1
.
0
;
[
self
updateTtsResultText
:
playingId
];
[
self
updateTtsResultText
:
playingId
];
});
});
if
(
self
.
ttsSynthesisFromPlayer
)
{
if
(
self
.
ttsSynthesisFromPlayer
)
{
if
(
self
.
ttsSynthesisIndex
==
(
self
.
ttsSynthesisText
.
count
-
1
))
{
if
(
self
.
ttsSynthesisIndex
==
0
)
{
// 播放完第一遍后自动停止
[
self
stopEngineBtnClicked
];
[
self
stopEngineBtnClicked
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
onRecieve
:)])
{
[
self
.
delegate
onRecieve
:@{
@"finish"
:
@
(
true
)}];
}
}
else
{
}
else
{
[
self
triggerSynthesis
];
[
self
triggerSynthesis
];
self
.
ttsSynthesisFromPlayer
=
FALSE
;
self
.
ttsSynthesisFromPlayer
=
FALSE
;
...
@@ -791,9 +797,6 @@ static int TTS_MAX_RETRY_COUNT = 3;
...
@@ -791,9 +797,6 @@ static int TTS_MAX_RETRY_COUNT = 3;
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论