Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Alexander
/
alex-hunter-sales-dev
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a1b08947
authored
Dec 04, 2022
by
Nick N. Sukharev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Обновлена версия модуля customTts.js до шаблонной
1 parent
ccfca291
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
customTts.js
customTts.js
View file @
a1b0894
...
@@ -36,7 +36,7 @@ class AudioResources
...
@@ -36,7 +36,7 @@ class AudioResources
}
}
const
audioFile
=
path
.
join
(
folder
,
phrase
.
audio
);
const
audioFile
=
path
.
join
(
folder
,
phrase
.
audio
);
if
(
!
fs
.
existsSync
(
audioFile
))
{
if
(
!
fs
.
existsSync
(
audioFile
))
{
errors
.
push
(
`For
${
i
}
phrase "
${
phrase
.
phrase
}
"
file not found`
);
errors
.
push
(
`For
${
i
}
phrase '
${
phrase
.
phrase
}
'
file not found`
);
continue
;
continue
;
}
}
phrase
.
voice
=
{
...
pack
.
voice
,
...
phrase
.
voice
};
phrase
.
voice
=
{
...
pack
.
voice
,
...
phrase
.
voice
};
...
@@ -48,24 +48,28 @@ class AudioResources
...
@@ -48,24 +48,28 @@ class AudioResources
}
}
this
.
resources
[
resourceKey
]
=
audioFile
;
this
.
resources
[
resourceKey
]
=
audioFile
;
}
}
if
(
errors
.
length
>
0
)
if
(
errors
.
length
>
0
)
{
{
console
.
error
(
`Was errors
${
JSON
.
stringify
(
errors
)}
`
)
console
.
error
(
`Was errors:
${
JSON
.
stringify
(
errors
,
undefined
,
2
)}
`
);
return
false
;
}
}
return
true
;
}
}
async
addFolder
(
folder
)
async
addFolder
(
folder
)
{
{
const
files
=
fs
.
readdirSync
(
folder
);
const
files
=
fs
.
readdirSync
(
folder
);
let
result
=
false
;
for
(
const
fileName
of
files
)
for
(
const
fileName
of
files
)
{
{
if
(
path
.
extname
(
fileName
)
===
".json"
)
if
(
path
.
extname
(
fileName
)
===
".json"
)
{
{
const
fname
=
path
.
join
(
folder
,
fileName
);
const
fname
=
path
.
join
(
folder
,
fileName
);
console
.
log
(
`Parsing
${
fname
}
`
);
console
.
log
(
`Parsing
${
fname
}
`
);
await
this
.
appendJson
(
folder
,
JSON
.
parse
(
fs
.
readFileSync
(
fname
).
toString
()));
result
=
await
this
.
appendJson
(
folder
,
JSON
.
parse
(
fs
.
readFileSync
(
fname
).
toString
()));
}
}
}
}
return
result
;
}
}
GetPath
(
text
,
voiceInfo
)
GetPath
(
text
,
voiceInfo
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment