Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
2fdb3b37
Commit
2fdb3b37
authored
Sep 12, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
洗稿增加音频时长
parent
dde1752c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
src/service/CreateLive.ts
+19
-8
src/utils/request.ts
+1
-1
No files found.
src/service/CreateLive.ts
View file @
2fdb3b37
...
...
@@ -491,12 +491,29 @@ export const onAudioProcessed = async (res: any, liveInfo: any) => {
let
resultList
=
await
audioStart
([
data
.
audio_address
],
true
);
// 转一维
resultList
=
dimensionalConvert
(
resultList
);
let
newList
=
[];
let
textScriptList
=
dimensionalConvert
(
liveInfo
[
createLiveKeys
.
textScriptList
]);
for
(
let
$j
=
0
;
$j
<
resultList
.
length
;
$j
++
)
{
let
row
=
resultList
[
$j
];
let
param
:
any
=
{
content
:
row
.
content
,
movement_type
:
textScriptList
[
i
].
movement_type
??
''
,
movement_name
:
textScriptList
[
i
].
movement_name
??
''
,
};
// 获取音频时长
let
duration
=
await
getDurationOfAudioFile
(
row
.
content
);
if
(
typeof
duration
===
'number'
)
{
param
.
duration
=
parseInt
(
duration
+
''
);
}
else
{
param
.
duration
=
0
;
}
newList
.
push
(
param
);
}
if
(
!
resultList
.
length
)
{
show_message
(
'洗稿失败'
);
writeLog
(
'洗稿回调中音频下载失败-audioStart'
);
return
;
}
let
textScriptList
=
dimensionalConvert
(
liveInfo
[
createLiveKeys
.
textScriptList
]);
list
.
push
({
movement
:
{
id
:
textScriptList
[
i
].
movement_id
,
...
...
@@ -504,13 +521,7 @@ export const onAudioProcessed = async (res: any, liveInfo: any) => {
name
:
textScriptList
[
i
].
movement_name
,
url
:
textScriptList
[
i
].
movement_url
,
},
list
:
resultList
.
map
((
row
:
any
)
=>
{
return
{
content
:
row
.
content
,
movement_type
:
textScriptList
[
i
].
movement_type
,
movement_name
:
textScriptList
[
i
].
movement_name
,
};
}),
list
:
newList
,
});
}
else
{
console
.
log
(
'洗稿缺少参数'
);
...
...
src/utils/request.ts
View file @
2fdb3b37
...
...
@@ -8,7 +8,7 @@ const error_messaage = '请求错误';
const
getBaseUrl
=
async
()
=>
{
if
(
isDev
())
{
return
'http://
156.247.11.21:93
'
;
return
'http://
rpc.chensav.top
'
;
return
''
;
}
// 默认线上地址
...
...
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