I’m having a weird error that goes Failed to load sound : NotEnoughQuota almost always when i try to use roblox’s text to speech feature. This error occurs when i attempt to play the sound after it’s generated.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local chatRemote = ReplicatedStorage:WaitForChild("PlayerChatMessage")
chatRemote.OnServerEvent:Connect(function(player, message, voiceId)
if typeof(message) ~= "string" or #message == 0 then return end
if typeof(voiceId) ~= "string" then voiceId = "3" end
if #message > 300 then message = message:sub(1, 300) end
local char = player.Character
local root = char and char:FindFirstChild("HumanoidRootPart")
if not root then return end
-- Create TTS (attach directly to root like an old Sound)
local tts = Instance.new("AudioTextToSpeech")
tts.Text = message
tts.VoiceId = voiceId
tts.Volume = 10
tts.Name = "TTS_Playback"
tts.Parent = root
-- Play and cleanup
tts:Play()
tts.Ended:Connect(function()
tts:Destroy()
end)
end)
This script worked in the past with no issue, I dont understand why it suddenly stopped working now.
