libpulse bindings for use with a GLib Mainloop via LGI.
https://docs.sclu1034.dev/lua-libpulse-glib/index.html
The way C modules are initialized was affected by one of the major breaking changes between 5.x versions. Rather than trying to cater to each version individually, we now just backport from newer versions. Namely from 5.2 to 5.1. |
||
---|---|---|
.ci | ||
doc | ||
rocks | ||
spec | ||
src/lua_libpulse_glib | ||
tools | ||
.busted.lua | ||
.clang-format | ||
.fdignore | ||
.gitignore | ||
.luacheckrc | ||
COPYING | ||
Makefile | ||
README.adoc |
lua-libpulse-glib
Quick Start
Install lgi and lua_libpulse_glib from LuaRocks:
luarocks install lgi
luarocks install --dev lua-libpulse-glib
local lgi = require("lgi")
local pulseaudio = require("lua_libpulse_glib")
local ppretty = require("pl.pretty")
local pa = pulseaudio.new()
local ctx = pa:context("My Test App")
local loop = lgi.GLib.MainLoop.new()
ctx:connect(nil, function(state)
if state == 4 then
print("Connection is ready")
ctx:get_sinks(function(sinks)
ppretty.dump(sinks)
loop:quit()
end)
end
end)
loop:run()