From 0998cfc1dcb8f7c01c16c74db6f0fbdcd3ca6863 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 15 Mar 2018 22:46:42 +0000 Subject: [PATCH] Add confirmation message to indicate that the voice files have been found. --- NXDNGateway/Voice.cpp | 6 ++++++ NXDNGateway/Voice.h | 1 + 2 files changed, 7 insertions(+) diff --git a/NXDNGateway/Voice.cpp b/NXDNGateway/Voice.cpp index 60f19dc..5bad6d6 100644 --- a/NXDNGateway/Voice.cpp +++ b/NXDNGateway/Voice.cpp @@ -45,6 +45,7 @@ const unsigned char BIT_MASK_TABLE[] = { 0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04 #define READ_BIT1(p,i) (p[(i)>>3] & BIT_MASK_TABLE[(i)&7]) CVoice::CVoice(const std::string& directory, const std::string& language, unsigned int srcId) : +m_language(language), m_indxFile(), m_ambeFile(), m_srcId(srcId), @@ -57,6 +58,9 @@ m_voiceData(NULL), m_voiceLength(0U), m_positions() { + assert(!directory.empty()); + assert(!language.empty()); + #if defined(_WIN32) || defined(_WIN64) m_indxFile = directory + "\\" + language + ".indx"; m_ambeFile = directory + "\\" + language + ".nxdn"; @@ -130,6 +134,8 @@ bool CVoice::open() ::fclose(fpindx); ::fclose(fpambe); + LogInfo("Loaded the audio and index file for %s", m_language.c_str()); + return true; } diff --git a/NXDNGateway/Voice.h b/NXDNGateway/Voice.h index 2284bd4..a811406 100644 --- a/NXDNGateway/Voice.h +++ b/NXDNGateway/Voice.h @@ -54,6 +54,7 @@ public: void clock(unsigned int ms); private: + std::string m_language; std::string m_indxFile; std::string m_ambeFile; unsigned int m_srcId;