Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LW_CheckAudioFileTool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
LW_CheckAudioFileTool
Commits
4beec0cf
Commit
4beec0cf
authored
Apr 20, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c5832a8f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9414 additions
and
548 deletions
+9414
-548
LW_CheckAudioFileTool.fire
...ts/LW_CheckAudioFileTool/scene/LW_CheckAudioFileTool.fire
+9
-9
LW_CheckAudioFileTool.ts
assets/LW_CheckAudioFileTool/scene/LW_CheckAudioFileTool.ts
+33
-6
defaultData_LW_CheckAudioFileTool.ts
...AudioFileTool/script/defaultData_LW_CheckAudioFileTool.ts
+9372
-533
No files found.
assets/LW_CheckAudioFileTool/scene/LW_CheckAudioFileTool.fire
View file @
4beec0cf
...
...
@@ -1958,7 +1958,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1
54.07
,
"width": 1
10.43
,
"height": 40.32
},
"_anchorPoint": {
...
...
@@ -2010,8 +2010,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "进度:
13/23
",
"_N$string": "进度:
13/23
",
"_string": "进度:
-/-
",
"_N$string": "进度:
-/-
",
"_fontSize": 28,
"_lineHeight": 32,
"_enableWrapText": true,
...
...
@@ -2053,7 +2053,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 9
9.57
,
"width": 9
3.32
,
"height": 40.32
},
"_anchorPoint": {
...
...
@@ -2105,8 +2105,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "成功:
1
",
"_N$string": "成功:
1
",
"_string": "成功:
-
",
"_N$string": "成功:
-
",
"_fontSize": 28,
"_lineHeight": 32,
"_enableWrapText": true,
...
...
@@ -2148,7 +2148,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 9
9.57
,
"width": 9
3.32
,
"height": 40.32
},
"_anchorPoint": {
...
...
@@ -2200,8 +2200,8 @@
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "失败:
2
",
"_N$string": "失败:
2
",
"_string": "失败:
-
",
"_N$string": "失败:
-
",
"_fontSize": 28,
"_lineHeight": 32,
"_enableWrapText": true,
...
...
assets/LW_CheckAudioFileTool/scene/LW_CheckAudioFileTool.ts
View file @
4beec0cf
...
...
@@ -64,6 +64,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
startBtn
.
on
(
"
click
"
,
()
=>
{
this
.
startCheck
();
})
this
.
stopBtn
.
on
(
"
click
"
,
()
=>
{
this
.
stopTest
();
})
}
initData
()
{
...
...
@@ -71,18 +75,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async
startCheck
()
{
this
.
isStop
=
false
;
const
audioUrl
=
[];
this
.
data
.
forEach
(
item
=>
{
audioUrl
.
push
({
id
:
item
.
id
,
type
:
"
cn
"
,
name
:
item
.
text_cn
,
audio_url
:
item
.
audio_cn_url
})
audioUrl
.
push
({
id
:
item
.
id
,
type
:
"
en
"
,
name
:
item
.
text_en
,
audio_url
:
item
.
audio_url
})
});
...
...
@@ -94,11 +97,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
updateSummaryInfo
()
for
(
let
i
=
0
;
i
<
audioUrl
.
length
;
i
++
)
{
const
res
=
await
this
.
testAudioPlay
(
audioUrl
[
i
].
audio_url
)
if
(
this
.
isStop
)
{
break
}
this
.
summaryInfo_now
=
i
+
1
;
if
(
res
)
{
this
.
inputText
(
`播放成功! id:
${
audioUrl
[
i
].
id
}
资源名:
${
audioUrl
[
i
].
name
}
`
);
this
.
inputText
(
`播放成功! id:
${
audioUrl
[
i
].
id
}
`
);
this
.
summaryInfo_success
++
;
}
else
{
this
.
inputText
(
`播放失败! id:
${
audioUrl
[
i
].
id
}
资源名:
${
audioUrl
[
i
].
name
}
`
);
this
.
inputText
(
`播放失败! id:
${
audioUrl
[
i
].
id
}
`
);
console
.
log
(
`Fail: id=
${
audioUrl
[
i
].
id
}
type=
${
audioUrl
[
i
].
type
}
`
)
this
.
summaryInfo_fail
++
;
}
...
...
@@ -107,6 +114,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
inputText
(
`检测完成,总计【
${
this
.
summaryInfo_total
}
】 成功【
${
this
.
summaryInfo_success
}
】 失败【
${
this
.
summaryInfo_fail
}
】`
);
}
isStop
=
false
;
stopTest
()
{
if
(
this
.
_intervalId
)
{
clearInterval
(
this
.
_intervalId
);
this
.
_intervalId
=
null
;
}
if
(
this
.
_resovle
)
{
this
.
_resovle
(
false
);
this
.
_resovle
=
null
;
}
this
.
isStop
=
true
;
}
// 输入文字
inputText
(
str
)
{
this
.
outputBox
.
getComponent
(
cc
.
Label
).
string
=
str
;
...
...
@@ -140,24 +161,30 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
_intervalId
=
null
;
_resovle
=
null
;
testAudioPlay
(
audio_url
)
{
return
new
Promise
((
resovle
,
reject
)
=>
{
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
)
=>
{
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.
8
);
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.
1
);
if
(
this
.
_intervalId
!=
null
)
{
clearInterval
(
this
.
_intervalId
);
this
.
_intervalId
=
null
;
}
let
count
=
0
;
this
.
_resovle
=
resovle
;
this
.
_intervalId
=
setInterval
(()
=>
{
if
(
cc
.
audioEngine
.
getCurrentTime
(
audioId
)
>
0
)
{
clearInterval
(
this
.
_intervalId
);
this
.
_intervalId
=
null
;
cc
.
audioEngine
.
stop
(
audioId
);
this
.
_resovle
=
null
;
resovle
(
true
)
}
else
{
if
(
count
>
50
)
{
clearInterval
(
this
.
_intervalId
);
this
.
_intervalId
=
null
;
cc
.
audioEngine
.
stop
(
audioId
);
this
.
_resovle
=
null
;
resovle
(
false
)
}
else
{
count
++
...
...
assets/LW_CheckAudioFileTool/script/defaultData_LW_CheckAudioFileTool.ts
View file @
4beec0cf
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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