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

Method addInt16ToFileData

AudioFile.h:1182–1199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1180//=============================================================
1181template <class T>
1182void AudioFile<T>::addInt16ToFileData (std::vector<uint8_t>& fileData, int16_t i, Endianness endianness)
1183{
1184 uint8_t bytes[2];
1185
1186 if (endianness == Endianness::LittleEndian)
1187 {
1188 bytes[1] = (i >> 8) & 0xFF;
1189 bytes[0] = i & 0xFF;
1190 }
1191 else
1192 {
1193 bytes[0] = (i >> 8) & 0xFF;
1194 bytes[1] = i & 0xFF;
1195 }
1196
1197 fileData.push_back (bytes[0]);
1198 fileData.push_back (bytes[1]);
1199}
1200
1201//=============================================================
1202template <class T>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected