mirror of
https://github.com/ShaYmez/NXDNClients.git
synced 2025-08-06 22:42:24 -04:00
Fix the gateway voice prompts.
This commit is contained in:
parent
4ccf9a9a78
commit
e946765a60
@ -189,8 +189,9 @@ void CVoice::createVoice(unsigned int tg, const std::vector<std::string>& words)
|
|||||||
unsigned char* ambeData = new unsigned char[ambeLength];
|
unsigned char* ambeData = new unsigned char[ambeLength];
|
||||||
|
|
||||||
// Fill the AMBE data with silence
|
// Fill the AMBE data with silence
|
||||||
for (unsigned int i = 0U; i < ambeLength; i += AMBE_LENGTH)
|
unsigned int offset = 0U;
|
||||||
::memcpy(ambeData + i, SILENCE, AMBE_LENGTH);
|
for (unsigned int i = 0U; i < (ambeLength / AMBE_LENGTH); i++, offset += AMBE_LENGTH)
|
||||||
|
::memcpy(ambeData + offset, SILENCE, AMBE_LENGTH);
|
||||||
|
|
||||||
// Put offset in for silence at the beginning
|
// Put offset in for silence at the beginning
|
||||||
unsigned int pos = SILENCE_LENGTH * AMBE_LENGTH;
|
unsigned int pos = SILENCE_LENGTH * AMBE_LENGTH;
|
||||||
@ -259,12 +260,12 @@ void CVoice::createVoice(unsigned int tg, const std::vector<std::string>& words)
|
|||||||
m_timer.start();
|
m_timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CVoice::read(unsigned char* data)
|
unsigned int CVoice::read(unsigned char* data)
|
||||||
{
|
{
|
||||||
assert(data != NULL);
|
assert(data != NULL);
|
||||||
|
|
||||||
if (m_status != VS_SENDING)
|
if (m_status != VS_SENDING)
|
||||||
return false;
|
return 0U;
|
||||||
|
|
||||||
unsigned int count = m_stopWatch.elapsed() / NXDN_FRAME_TIME;
|
unsigned int count = m_stopWatch.elapsed() / NXDN_FRAME_TIME;
|
||||||
|
|
||||||
@ -281,10 +282,10 @@ bool CVoice::read(unsigned char* data)
|
|||||||
m_status = VS_NONE;
|
m_status = VS_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return NXDN_FRAME_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVoice::abort()
|
void CVoice::abort()
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
void linkedTo(unsigned int tg);
|
void linkedTo(unsigned int tg);
|
||||||
void unlinked();
|
void unlinked();
|
||||||
|
|
||||||
bool read(unsigned char* data);
|
unsigned int read(unsigned char* data);
|
||||||
|
|
||||||
void abort();
|
void abort();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user