Go to file
BuckarooBanzay 4191aaf9a6 fix code highlight typo 2020-12-21 11:00:58 +01:00
.github/workflows gh action 2019-12-20 08:06:19 +01:00
mods horror support 2019-12-20 08:05:42 +01:00
textures runtime fixes 2019-04-29 18:10:05 +02:00
.luacheckrc add digiline interface / switch to mod.conf 2020-12-21 10:50:18 +01:00
api.lua ordering / stop sound 2019-11-22 09:52:05 +01:00
digiline.lua add digiline interface / switch to mod.conf 2020-12-21 10:50:18 +01:00
form.lua mesecons compat 2019-11-23 19:38:00 +01:00
init.lua add digiline interface / switch to mod.conf 2020-12-21 10:50:18 +01:00
license.txt initial files 2019-04-29 11:07:48 +02:00
mod.conf add digiline interface / switch to mod.conf 2020-12-21 10:50:18 +01:00
readme.md fix code highlight typo 2020-12-21 11:00:58 +01:00
recipe.lua cleanup 2019-11-23 19:20:12 +01:00
soundblock.lua add digiline interface / switch to mod.conf 2020-12-21 10:50:18 +01:00

readme.md

A soundblock that emits sounds with given interval or per mesecon signal

Api

Register custom sounds:

soundblocks.register({
  filename = "default_glass_footstep.ogg",
  key = "default_glass_footsteps",
  name = "Glass footsteps"
})


soundblocks.register({
  filenames = {
    "default_grass_footstep.1.ogg",
    "default_grass_footstep.2.ogg",
    "default_grass_footstep.3.ogg"
  },
  key = "default_grass_footstep",
  name = "Grass footsteps"
})

Digiline api

if event.type == "program" then
 digiline_send("soundblock", {
  command = "play",
	name = "default_grass_footstep.1.ogg",
	-- relative position (optional)
	pos = { x=0, y=10, z=0 },
	-- gain, defaults to 1
	gain = 1,
	-- max_hear_distance, defaults to 10
	hear_distance = 32
 })
end

License

See license.txt

textures/soundblock_block.png