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!
SPAM - Simple Powerful Audio Manager
SPAM - Simple Powerful Audio Manager
Last edited by Eamonn on Sat Aug 09, 2014 11:52 pm, edited 4 times in total.
"In those quiet moments, you come into my mind" - Liam Reilly
Re: SPAM - Simple Powerful Audio Manager
Welcome back comrade, very nice library.
Last edited by jjmafiae on Sat Jun 07, 2014 8:09 pm, edited 1 time in total.
Re: SPAM - Simple Powerful Audio Manager
Thanks comrade! Glad you like it!jjmafiae wrote:Welcome back, very nice library.
"In those quiet moments, you come into my mind" - Liam Reilly
Re: SPAM - Simple Powerful Audio Manager
Awesome. This will be useful
My itch.io page is:
http://roggie.itch.io/
Twitter:
https://twitter.com/RoggieGaming
Website:
http://roggiegaming.comxa.com/
Blog:
http://urnet.net78.net/RoggieGaming
http://roggie.itch.io/
Twitter:
https://twitter.com/RoggieGaming
Website:
http://roggiegaming.comxa.com/
Blog:
http://urnet.net78.net/RoggieGaming
-
- Prole
- Posts: 44
- Joined: Sat Dec 15, 2012 7:55 am
Re: SPAM - Simple Powerful Audio Manager
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.
And the Delete function is misspelled.
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.
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
Code: Select all
function Spam:Delte( name )
sounds[name] = nil
end
Code: Select all
Spam = {"pork", "salt", "water", "potato starch", "sugar", "sodium nitrate"}
SpamLib = require("spam")
Re: SPAM - Simple Powerful Audio Manager
Please make a github repo.
Re: SPAM - Simple Powerful Audio Manager
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 methodsSiENcE wrote:Please make a github repo.
https://github.com/sonic2kk/SPAM
"In those quiet moments, you come into my mind" - Liam Reilly
Re: SPAM - Simple Powerful Audio Manager
Nice, I have to check it.
Some suggestions.
I would make the library locally instanceable.
I would also shorten the commands.
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").
Some suggestions.
I would make the library locally instanceable.
Code: Select all
local xyz = require "spam"
xyz:newsource()
...
Code: Select all
xyz:play
xyz:setloop
xyz:pause
...
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").
Who is online
Users browsing this forum: No registered users and 3 guests