MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / floatToInt16

Function floatToInt16

src/core/TxMicChannelNormalizer.cpp:41–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41int16_t floatToInt16(float sample)
42{
43 const float clamped = std::clamp(finiteOrZero(sample), -1.0f, 1.0f);
44 return static_cast<int16_t>(std::clamp(static_cast<int>(clamped * 32767.0f),
45 -32768,
46 32767));
47}
48
49ChannelMode resolveManualMode(ChannelMode requested)
50{

Callers 1

Calls 1

finiteOrZeroFunction · 0.85

Tested by

no test coverage detected