make silence chunks useful/correct
This commit is contained in:
parent
89f28d5090
commit
2d8000b023
@ -190,14 +190,15 @@ void VoiceDataWriter::EndCommandPacket(const PacketTrailingBits& trailingBits)
|
|||||||
if(!m_isSilenced)
|
if(!m_isSilenced)
|
||||||
{
|
{
|
||||||
m_isSilenced = true;
|
m_isSilenced = true;
|
||||||
m_silence.emplace_back(std::make_pair(m_curTick, 0));
|
m_silenceTicksStart = m_silenceTicks;
|
||||||
|
m_silence.emplace_back(std::make_pair(m_curTick - m_silenceTicks, 0));
|
||||||
}
|
}
|
||||||
m_silenceTicks += (m_curTick - m_lastTick);
|
m_silenceTicks += (m_curTick - m_lastTick);
|
||||||
}
|
}
|
||||||
else if(m_isSilenced)
|
else if(m_isSilenced)
|
||||||
{
|
{
|
||||||
m_isSilenced = false;
|
m_isSilenced = false;
|
||||||
m_silence.back().second = m_curTick;
|
m_silence.back().second = m_silenceTicks - m_silenceTicksStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto& state : m_playerVoiceStates)
|
for(auto& state : m_playerVoiceStates)
|
||||||
|
@ -86,6 +86,7 @@ private:
|
|||||||
|
|
||||||
int32_t m_lastVoiceTick = 0;
|
int32_t m_lastVoiceTick = 0;
|
||||||
int32_t m_silenceTicks = 0;
|
int32_t m_silenceTicks = 0;
|
||||||
|
int32_t m_silenceTicksStart = 0;
|
||||||
const char* m_outputPath = nullptr;
|
const char* m_outputPath = nullptr;
|
||||||
|
|
||||||
int16_t m_decodeBuffer[32768];
|
int16_t m_decodeBuffer[32768];
|
||||||
|
Loading…
Reference in New Issue
Block a user