Boosting audio volume on AudioEmitters / AudioTextToSpeech

Since the AudioTextToSpeech is limited to volume level 3 the only possible way that ive thought is using an audio emitter. Trying to boost the audio since its very quiet at the moment. When using, the code snippet below it breaks the code and results in not playing the audio at all.

			Emitter.DistanceAttenuationMode = Enum.DistanceAttenuationMode.Custom
			
			Emitter:SetDistanceAttenuation({[0] = 1.0, [100] = 1.0})

Full Snippet:

local Speakers = {}

function Speakers.PlaySpeaker(Audiotype, folder)
	for _, speaker in ipairs(folder:GetDescendants()) do
		if speaker:IsA("BasePart") then
			local ATTS = Instance.new("AudioTextToSpeech")
			ATTS.Parent = speaker
			ATTS.Text = Audiotype
			ATTS.Speed = 0.7
			ATTS.Volume = 2
			ATTS.VoiceId = 5
			
			local Emitter = Instance.new("AudioEmitter")
			Emitter.Parent = speaker
			Emitter.DistanceAttenuationMode = Enum.DistanceAttenuationMode.Custom
			
			Emitter:SetDistanceAttenuation({[0] = 1.0, [100] = 1.0})
			
			local Wire = Instance.new("Wire")
			Wire.Parent = speaker
			Wire.SourceInstance = ATTS
			Wire.TargetInstance = Emitter
			
			ATTS:Play()
			
			repeat
				task.wait()
			until ATTS.TimeLength > 0 or not ATTS.IsPlaying
			
			if ATTS.TimeLength > 0 then
				task.wait(ATTS.TimeLength)
			end
			
			Wire:Destroy()
			Emitter:Destroy()
			ATTS:Destroy()
		end
	end
end

return Speakers

I may be incorrect but im pretty sure that you cant really use a AudioEmitter because its gain cant go over 1. I’d also test the Emitter.DistanceAttenuationMode = Enum.DistanceAttenuationMode.Inverse bit too just in case.

Ignore that bit, it might just be the custom distance attenuation. I would give it specific values maybe?

Emitter.DistanceAttenuationMode = Enum.DistanceAttenuationMode.Custom
Emitter:SetDistanceAttenuation({[0] = 1, [100] = 1, [500] = 1, [1000] = 1,})

You can wire the AudioTextToSpeech to an AudioFader to boost the volume.