MCPcopy Create free account
hub / github.com/adamstark/AudioFile / twentyFourBitIntToSample

Method twentyFourBitIntToSample

AudioFile.h:1389–1402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1387//=============================================================
1388template <class T>
1389T AudioSampleConverter<T>::twentyFourBitIntToSample (int32_t sample)
1390{
1391 if constexpr (std::is_floating_point<T>::value)
1392 {
1393 return static_cast<T> (sample) / static_cast<T> (8388607.);
1394 }
1395 else if (std::numeric_limits<T>::is_integer)
1396 {
1397 if constexpr (std::is_signed_v<T>)
1398 return static_cast<T> (clamp (sample, SignedInt24_Min, SignedInt24_Max));
1399 else
1400 return static_cast<T> (clamp (sample + 8388608, UnsignedInt24_Min, UnsignedInt24_Max));
1401 }
1402}
1403
1404//=============================================================
1405template <class T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected