Skip to content
/ SPAM Public

SPAM (Simple Powerful Audio Manager) is an audio manager created for use with the game development framework/engine LÖVE (Love2d)

License

Notifications You must be signed in to change notification settings

sonic2kk/SPAM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SPAM - Simple Powerful Audio Manager

SPAM (Simple Powerful Audio Manager) is a small audio manager for the LÖVE (Love2d) game development framework. It is 4KB, and it relativly easy to use and very easy to just add to your game. To add it to your game, simply add spam.lua to your game code directory, and require it like so:

-- This way...
require("spam")

-- ... or this way
require "spam"

Here is an example of how to use SPAM in your game:

require('spam')

local mn = "manager1"

function love.load()
  spam_newmanager(mn)

  spam_newsource(mn, 'bgm', 'audioclip.extension', 'audiotype')

  spam_setloopsource(mn, 'bgm', true)

  spam_playsource(mn, 'bgm')
end

function love.update(dt)
  
end

function love.draw()
  
end

License

License can be found at "license.txt"

Documentation

spam_newmanager(mname)

Creates a new SPAM audio manager

mname - Name of the manager


spam_newsource(mname, sname, path, type)

Creates a new SPAM audio source

mname - Name of the manager

sname - Name of the source

path - Path to the source

type - Type of the source


spam_removesource(mname, sname)

Removes a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_setloopsource(mname, sname, loop)

Whether or not to loop a SPAM audio source

mname - Name of the manager

sname - Name of the source

loop - Whether or not to loop the audio source


spam_setvolume(mname, sname, vol)

Sets the volume of a SPAM audio source

mname - Name of the manager

sname - Name of the source

vol - Volume to set of the audio source


spam_getvolume(mname, sname)

Gets the volume of a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_stopaudiosource(mname, sname)

Stops a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_playsource(mname, sname)

Plays a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_pausesource(mname, sname)

Pauses a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_getsource(mname, sname)

Gets a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_resumesource(mname, sname)

Resumes a SPAM audio source

mname - Name of the manager

sname - Name of the source


spam_issourceplaying(mname, sname)

Checks if a given source is currently playing

mname - Name of the manager

sname - Name of the source


spam_issourcelooping(mname, sname)

Checks if a given source is set to loop

mname - Name of the manager

sname - Name of the source


spam_isstatic(mname, sname)

Checks if a source is static

mname - Name of the manager

sname - Name of the source


spam_getposition(mname, sname, unit)

Checks the position of a given SPAM source

mname - Name of the manager

sname - Name of the source

unit - Unit to return the position in


spam_ispaused(mname, sname)

Checks if a given SPAM audio source is paused

mname - Name of the manager

sname - Name of the source


spam_getversion()

Gets the current version of SPAM

About

SPAM (Simple Powerful Audio Manager) is an audio manager created for use with the game development framework/engine LÖVE (Love2d)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages