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

Method twoBytesToInt

AudioFile.h:1254–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1252//=============================================================
1253template <class T>
1254int16_t AudioFile<T>::twoBytesToInt (const std::vector<uint8_t>& source, int startIndex, Endianness endianness)
1255{
1256 int16_t result;
1257
1258 if (endianness == Endianness::LittleEndian)
1259 result = (source[startIndex + 1] << 8) | source[startIndex];
1260 else
1261 result = (source[startIndex] << 8) | source[startIndex + 1];
1262
1263 return result;
1264}
1265
1266//=============================================================
1267template <class T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected