Fix default endianness in Sound:generateString

This commit is contained in:
nucular 2016-09-18 23:51:46 +02:00
parent b5940ce0c6
commit 51635d7aaf

View File

@ -808,6 +808,7 @@ end
function sfxr.Sound:generateString(rate, depth, endianness) function sfxr.Sound:generateString(rate, depth, endianness)
rate = rate or 44100 rate = rate or 44100
depth = depth or 16 depth = depth or 16
endianness = endianness or 0
assert(sfxr.SAMPLERATE[rate], "invalid sampling rate: " .. tostring(rate)) assert(sfxr.SAMPLERATE[rate], "invalid sampling rate: " .. tostring(rate))
assert(sfxr.BITDEPTH[depth] and depth ~= 0, "invalid bit depth: " .. tostring(depth)) assert(sfxr.BITDEPTH[depth] and depth ~= 0, "invalid bit depth: " .. tostring(depth))
assert(sfxr.ENDIANNESS[endianness], "invalid endianness: " .. tostring(endianness)) assert(sfxr.ENDIANNESS[endianness], "invalid endianness: " .. tostring(endianness))