Fix incorrect cast when loading 16-bit samples from WAV file

This commit is contained in:
kimci86 2022-05-06 15:35:44 +02:00 committed by Lukas Dürrenberger
parent 33cb8f4391
commit 9842c8fdf8

View File

@ -50,7 +50,7 @@ namespace
if (static_cast<std::size_t>(stream.read(bytes, static_cast<sf::Int64>(sizeof(bytes)))) != sizeof(bytes))
return false;
value = static_cast<sf::Uint8>(bytes[0] | (bytes[1] << 8));
value = static_cast<sf::Int16>(bytes[0] | (bytes[1] << 8));
return true;
}