MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / EncodeSample

Function EncodeSample

AudioEncode/aencode.cpp:955–972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void EncodeSample(Encoder &enc) {
956 int32_t sample = 0;
957 if (enc.m_finishedReading == 0) {
958 sample = (*enc.m_reader)(enc.m_pReaderData);
959 if (sample == ReadSampleEof) {
960 enc.m_finishedReading = 1;
961 return;
962 }
963
964 ++enc.m_sampleCount;
965 }
966
967 *enc.m_pCurrBlockData++ = enc.m_volume * float(sample);
968
969 if (--enc.m_blockSamplesRemaining == 0) {
970 ProcessBlock(enc);
971 }
972}
973
974void EncodeFlush(Encoder &enc) {
975 if (enc.m_samplesPerBlock == enc.m_blockSamplesRemaining) {

Callers 1

AudioEncodeFunction · 0.85

Calls 1

ProcessBlockFunction · 0.85

Tested by

no test coverage detected