So, i was not fine with roblox audio, i mean, it cut off RollOffMax/Min really instant, i wanted to smooth it, so i did this:
for now, i played with Equalizer Settings, it sounds more clear.
So, i was not fine with roblox audio, i mean, it cut off RollOffMax/Min really instant, i wanted to smooth it, so i did this:
for now, i played with Equalizer Settings, it sounds more clear.
Whole setup looks like this:
local DSS = require(script.Parent.DSS)
DSS:Add(workspace:WaitForChild("Se").Sound)
Here DSS itself and config:
-- DSS
local RunService = game:GetService("RunService")
assert(RunService:IsClient()==true, "DSS is to be run on client side.")
local Config = require(script.Parent:WaitForChild("Config"))
local ABS, COS, DEG, ACOS = math.abs, math.cos, math.deg, math.acos
local DSS = {}
function DSS:Add( Sound)
local OriginalVolume = Sound.Volume
local OriginalPlaybackSpeed = Sound.PlaybackSpeed
local SoundPosition = Sound.Parent.Position
local Listener = Config.Listener
local EQ = Sound:FindFirstChildOfClass("EqualizerSoundEffect") or Instance.new("EqualizerSoundEffect", Sound)
EQ.LowGain = Config.EQ.LOWGAIN
local REVERB = Sound:FindFirstChildOfClass("ReverbSoundEffect") or Instance.new("ReverbSoundEffect", Sound)
REVERB.WetLevel = 1
RunService.RenderStepped:Connect(function(dt)
local Distance = (SoundPosition - Listener.Position).Magnitude
local MDistance = Sound.RollOffMaxDistance
local Angle = DEG(ACOS((SoundPosition-Listener.Position).Unit:Dot(Listener.CFrame.LookVector)))
Sound.Volume = (Distance < MDistance) and (1 - Distance/MDistance)--[[*ABS(COS(Angle))]] or 0
EQ.MidGain = (Distance < MDistance) and (-Config.EQ.MIDGAIN + Config.EQ.MIDGAIN * Distance/MDistance + Config.EQ.MIDGAIN * ABS(Angle)/90)
EQ.HighGain = (Distance < MDistance) and (Config.EQ.HIGHGAIN + Config.EQ.HIGHGAIN * Distance/MDistance + Config.EQ.HIGHGAIN * ABS(Angle)/90)
REVERB.DecayTime = (Distance < MDistance) and (Config.REVERB.DecayTime + Config.REVERB.DecayTime * (1 - Distance / MDistance) - Config.REVERB.DecayTime * ABS(Angle) / 90)
end)
end
return DSS
-- Config
local Config = {
Listener = script.Parent.Parent:WaitForChild("HumanoidRootPart"),
EQ = {
LOWGAIN = 6,
MIDGAIN = 3,
HIGHGAIN = 3
},
REVERB = {
DecayTime = 10
}
}
return Config
idk if my question is smthing lol but what is that music?
idk picked up from toolbox, so not really know, i switched it already.