Skip to content

Default to a love-supported bit depth for SoundData #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sfxr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ end
-- @raise "invalid sampling rate: x", "invalid bit depth: x"
function sfxr.Sound:generateSoundData(rate, depth, sounddata)
rate = rate or 44100
depth = depth or 0
depth = depth or 8 -- love supports 8 and 16
assert(sfxr.SAMPLERATE[rate], "invalid sampling rate: " .. tostring(rate))
assert(sfxr.BITDEPTH[depth] and depth, "invalid bit depth: " .. tostring(depth))

Expand Down