Commit 1159eba3 authored by jwendt's avatar jwendt
Browse files

added guard so that TTS voices are only loaded once, if present in multiple search paths

parent f17729f6
......@@ -463,8 +463,14 @@ void CVATextToSpeechSignalSource::TTSEngine::Init(){
VA_WARN("CVATextToSpeechSignalSource", "The associated license file ("+licence_file+") does not exist, cannot load voice");
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 + "\"");
......@@ -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{
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment