Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_debug
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
middleLayer_for_debug
Commits
6cc1644e
Commit
6cc1644e
authored
Feb 21, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 录音调整
parent
5268c0b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
air.js
assets/middleLayer_for_debug/script/air.js
+6
-15
No files found.
assets/middleLayer_for_debug/script/air.js
View file @
6cc1644e
...
...
@@ -96,22 +96,14 @@ export function initAir(_this) {
gameEnd
()
{
_this
.
log
(
`===成功调用gameEnd===`
);
},
startRecord
(
test
Text
)
{
_this
.
log
(
`===成功调用startRecord===
testText ==
${
test
Text
}
`
);
startRecord
(
isSpeechTo
Text
)
{
_this
.
log
(
`===成功调用startRecord===
isSpeechToText ==
${
isSpeechTo
Text
}
`
);
window
.
courseware
.
hasCalledStartRecord
=
true
;
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
"
params
"
:
test
Text
});
window
.
courseware
.
callOcMethod
(
"
startRecord
"
,
{
isSpeechTo
Text
});
},
stopRecord
(
isSpeechToText
,
_
callback
)
{
stopRecord
(
callback
)
{
window
.
courseware
.
hasCalledStartRecord
=
false
;
_this
.
log
(
`===成功调用stopRecord=== isSpeechToText ==
${
isSpeechToText
}
`
);
let
callback
=
_callback
;
let
_isSpeechToText
;
if
(
isSpeechToText
&&
typeof
isSpeechToText
===
"
function
"
)
{
callback
=
isSpeechToText
;
_isSpeechToText
=
1
;
}
else
{
_isSpeechToText
=
isSpeechToText
;
}
_this
.
log
(
`===成功调用stopRecord===`
);
if
(
!
callback
)
{
// 不传回调函数就表示取消评测
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
1
});
...
...
@@ -119,13 +111,12 @@ export function initAir(_this) {
}
// 结束录音
window
.
air
.
recordCallBack
=
(
res
)
=>
{
callback
&&
callback
(
JSON
.
stringify
(
res
));
res
=
typeof
(
res
)
==
'
string
'
?
res
:
JSON
.
stringify
(
res
);
_this
.
log
(
`===成功调用recordCallBack=== res ==
${
res
}
`
);
callback
&&
callback
(
res
);
window
.
air
.
recordCallBack
=
null
;
};
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
0
,
isSpeechToText
:
_isSpeechToText
});
window
.
courseware
.
callOcMethod
(
"
stopRecord
"
,
{
isBreak
:
0
});
},
startTest
(
testText
,
option
)
{
window
.
courseware
.
hasCalledStartTest
=
true
;
...
...
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