Implementing this feature would be very helpful. Long time ago, I really needed such functionality, and due to its absence, very valuable information from voice chat in dem files was irretrievably lost forever.
So, in one of my projects, I implemented this by intercepting the CL_WriteDemoMessage and the Voice_GetCompressedData functions. I will try to provide an algorithm that describes the implementation.
Create a global buffer sizebuf_t voice_buf;.
In Voice_GetCompressedData function, I put my own handler, which writes pchDest (that is filled in the original Voice_GetCompressedData function) data to the voice_buf buffer. It looks like this:
int hkVoice_GetCompressedData(char *pchDest, int nCount, qboolean bFinal)
{
int ret = orgVoice_GetCompressedData(pchDest, nCount, bFinal);
if (ret && cls.demorecording && !Voice_GetLoopback())
{
MSG_WriteBuf(&voice_buf, ret, pchDest);
if (voice_buf.flags & SIZEBUF_OVERFLOWED)
{
SZ_Clear(&voice_buf);
}
}
return ret;
}
In CL_WriteDemoMessage function, I put my own handler, which writes data from voice_buf to the msg buffer, clearing it after. It looks like this:
Now your own voice data will be recorded even with voice_loopback 0. @mikela-valve , I believe that such functionality is worthy of implementation due to its extreme usefulness. Can you provide its official implementation, please?
This report was inspired by #2414.
Implementing this feature would be very helpful. Long time ago, I really needed such functionality, and due to its absence, very valuable information from voice chat in dem files was irretrievably lost forever.
So, in one of my projects, I implemented this by intercepting the
CL_WriteDemoMessage
and theVoice_GetCompressedData
functions. I will try to provide an algorithm that describes the implementation.Create a global buffer
sizebuf_t voice_buf;
.In
Voice_GetCompressedData
function, I put my own handler, which writespchDest
(that is filled in the originalVoice_GetCompressedData
function) data to thevoice_buf
buffer. It looks like this:CL_WriteDemoMessage
function, I put my own handler, which writes data fromvoice_buf
to themsg
buffer, clearing it after. It looks like this:Now your own voice data will be recorded even with
voice_loopback 0
. @mikela-valve , I believe that such functionality is worthy of implementation due to its extreme usefulness. Can you provide its official implementation, please?