[Release] mumble-voip, rp-radio

maybe step outside your mind for a second and actually look for something

no native codegen for them yet but they exist and should be usable

old code sample:

local n = setmetatable({}, {
    __index = function(t, k)
        return function(...)
            return Citizen.InvokeNative(GetHashKey(k) & 0xFFFFFFFF, ...)
        end
    end
})

local r = n.GET_AUDIOCONTEXT_FOR_CLIENT(1, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
local s = n.AUDIOCONTEXT_GET_SOURCE(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
local d = n.AUDIOCONTEXT_GET_DESTINATION(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())

n.AUDIOCONTEXT_DISCONNECT(r, d, s, 0, 0)

Wait(0)

local function makeObject(data)
    local d = msgpack.pack(data)

    return string.pack('<T', #d) .. d
end

local curve = {}
local k = 400

local deg = math.pi / 180

for i = 1, 48000 do
    local x = (i - 1) * 2 / 48000 - 1;
    curve[i] = ( 3 + k ) * x * 20 * deg / ( math.pi + k * math.abs(x) );
end

bfn = n.AUDIOCONTEXT_CREATE_WAVESHAPERNODE(r, Citizen.ResultAsLong(), Citizen.ReturnResultAnyway())
n.WAVESHAPERNODE_SET_CURVE(bfn, makeObject(curve))

n.AUDIOCONTEXT_CONNECT(r, bfn, s, 0, 0)
n.AUDIOCONTEXT_CONNECT(r, d, bfn, 0, 0)
1 Like