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

Method sixteenBitIntToSample

AudioFile.h:1424–1437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422//=============================================================
1423template <class T>
1424T AudioSampleConverter<T>::sixteenBitIntToSample (int16_t sample)
1425{
1426 if constexpr (std::is_floating_point<T>::value)
1427 {
1428 return static_cast<T> (sample) / static_cast<T> (32767.);
1429 }
1430 else if constexpr (std::numeric_limits<T>::is_integer)
1431 {
1432 if constexpr (std::is_signed_v<T>)
1433 return static_cast<T> (sample);
1434 else
1435 return static_cast<T> (convertSignedToUnsigned<int16_t> (sample));
1436 }
1437}
1438
1439//=============================================================
1440template <class T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected