SPAM - Simple Powerful Audio Manager

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

SPAM - Simple Powerful Audio Manager

Post 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!
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
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: SPAM - Simple Powerful Audio Manager

Post by jjmafiae »

Welcome back comrade, very nice library.
Last edited by jjmafiae on Sat Jun 07, 2014 8:09 pm, edited 1 time in total.
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: SPAM - Simple Powerful Audio Manager

Post by Eamonn »

jjmafiae wrote:Welcome back, very nice library.
Thanks comrade! Glad you like it! :D
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
roggie
Prole
Posts: 22
Joined: Sat May 31, 2014 2:52 pm
Location: I think it's Earth
Contact:

Re: SPAM - Simple Powerful Audio Manager

Post by roggie »

Awesome. This will be useful :awesome:
rexjericho
Prole
Posts: 44
Joined: Sat Dec 15, 2012 7:55 am

Re: SPAM - Simple Powerful Audio Manager

Post 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")
User avatar
SiENcE
Party member
Posts: 795
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: SPAM - Simple Powerful Audio Manager

Post by SiENcE »

Please make a github repo.
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: SPAM - Simple Powerful Audio Manager

Post 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 :D

https://github.com/sonic2kk/SPAM
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
SiENcE
Party member
Posts: 795
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: SPAM - Simple Powerful Audio Manager

Post 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").
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests