Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VACore
Commits
1159eba3
Commit
1159eba3
authored
Jun 26, 2017
by
jwendt
Browse files
added guard so that TTS voices are only loaded once, if present in multiple search paths
parent
f17729f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Audiosignals/VATextToSpeechSignalSource.cpp
View file @
1159eba3
...
...
@@ -463,8 +463,14 @@ void CVATextToSpeechSignalSource::TTSEngine::Init(){
VA_WARN
(
"CVATextToSpeechSignalSource"
,
"The associated license file ("
+
licence_file
+
") does not exist, cannot load voice"
);
continue
;
}
if
(
m_loadedVoices
.
find
((
*
it
)
->
GetLocalName
())
!=
m_loadedVoices
.
end
())
continue
;
//so we do not load the same voice multiple times if it is in multiple directories in which we search
CPRCEN_engine_load_voice
(
m_pTTSEngine
,
licence_file
.
c_str
(),
NULL
,
name
.
c_str
(),
CPRC_VOICE_LOAD
);
VA_INFO
(
"CVATextToSpeechSignalSource"
,
"Loaded voice
\"
"
+
name
+
"
\"
"
);
m_loadedVoices
.
insert
((
*
it
)
->
GetLocalName
());
}
}
...
...
src/Audiosignals/VATextToSpeechSignalSource.h
View file @
1159eba3
...
...
@@ -11,6 +11,8 @@
#include <ITAAudioSample.h>
#include <ITAAtomicPrimitives.h>
#include <unordered_set>
class
ITABufferDatasource
;
class
CVACoreImpl
;
class
CPRCEN_engine
;
...
...
@@ -103,6 +105,7 @@ private:
std
::
map
<
int
,
std
::
string
>
m_idToViseme
;
float
m_sampleRate
;
std
::
vector
<
std
::
string
>
m_VoicePaths
;
std
::
unordered_set
<
std
::
string
>
m_loadedVoices
;
};
struct
UserCallbackData
{
...
...
Write
Preview
Supports
Markdown
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