Page 1 of 1
SPAM - Simple Powerful Audio Manager
Posted: Sat Jun 07, 2014 6:41 pm
by Eamonn
SPAM - Simple Powerful Audio Manager
SPAM is a small (4KB) audio library for LÖVE. The library was recently 100% rewritten and overhauled to make it more Lua-like. For documentation, how-to's, and downloads check out the GitHub repo:
https://github.com/sonic2kk/SPAM
Have a great day!
Re: SPAM - Simple Powerful Audio Manager
Posted: Sat Jun 07, 2014 7:39 pm
by jjmafiae
Welcome back comrade, very nice library.
Re: SPAM - Simple Powerful Audio Manager
Posted: Sat Jun 07, 2014 7:57 pm
by Eamonn
jjmafiae wrote:Welcome back, very nice library.
Thanks comrade! Glad you like it!
Re: SPAM - Simple Powerful Audio Manager
Posted: Tue Jun 17, 2014 8:41 pm
by roggie
Awesome. This will be useful
Re: SPAM - Simple Powerful Audio Manager
Posted: Tue Jun 17, 2014 11:21 pm
by rexjericho
Hey, I took a look at the code and noticed some minor bugs:
The StopAll and DeleteAll functions will only stop/delete sounds that are indexed by numbers, but from your examples it looks like you intend for the user to index their sounds by strings. Using the pairs() function instead will allow you to iterate over all key-value pairs. Easy mistake to make.
Code: Select all
function Spam:StopAll()
for i, v in ipairs(sounds) do
sounds[i]:stop()
end
end
function Spam:DeleteAll()
for i, v in ipairs(sounds) do
table.remove(sounds, v)
end
end
And the Delete function is misspelled.
Code: Select all
function Spam:Delte( name )
sounds[name] = nil
end
Also, I would suggest making the Spam table local (at line 1) and then returning the table at the end of the file. This way, the user is able to easily rename the table if needed. The user might already have an existing variable named "Spam" that they don't want overwritten.
Code: Select all
Spam = {"pork", "salt", "water", "potato starch", "sugar", "sodium nitrate"}
SpamLib = require("spam")
Re: SPAM - Simple Powerful Audio Manager
Posted: Wed Jun 18, 2014 12:41 pm
by SiENcE
Please make a github repo.
Re: SPAM - Simple Powerful Audio Manager
Posted: Sat Aug 09, 2014 11:52 pm
by Eamonn
SiENcE wrote:Please make a github repo.
I edited it a lot since I posted it here. GitHub repo is right here my friend! I'll also update the OP as well. I added some extra methods
https://github.com/sonic2kk/SPAM
Re: SPAM - Simple Powerful Audio Manager
Posted: Sun Aug 10, 2014 8:17 pm
by SiENcE
Nice, I have to check it.
Some suggestions.
I would make the library locally instanceable.
Code: Select all
local xyz = require "spam"
xyz:newsource()
...
I would also shorten the commands.
Code: Select all
xyz:play
xyz:setloop
xyz:pause
...
The real benefit of this library is limited, as it only maps the commands from löve.
You might want to introduce new features like an easy setup to play
3D sound effects. The current description in the löve wiki about OpenAL 3d setup is very limited and there is no sound library for LÖVE to easily make an 3d audio setup. Also some features from OpenAL are unused (like multi speaker setup -> "alsoft.ini").