Sound AudioPlayer Not working!

The sound will not delete and end before time is over someone, makes 2 songs after one is finished being played.

Help would be nice!

local SoundService = game.SoundService
local Provider = game:GetService("ContentProvider")
local playingfolder = SoundService:WaitForChild("MusicLoop")

local audioList = {
	["Dua Lipa - Levitating"] = 5215548352;
	["Dua Lipa - Pretty Please"] = 5215539201;
	["Ariana Grande - 7 Rings"] = 5624503572;
}

for Name, AudioID in pairs(audioList) do
	local NewSound = Instance.new("Sound" , playingfolder)
	NewSound.SoundId = "rbxassetid://"..AudioID
	NewSound.Name = Name
	NewSound.Playing = true
	table.insert(audioList , NewSound)
	Provider:PreloadAsync(audioList)
	
	NewSound:Play()
	
	wait(NewSound.TimeLength)
	
	NewSound:Stop()
	NewSound:Destroy()
end

.

local SoundService = game:GetService("SoundService")
local audioList = {
    ["Dua Lipa - Levitating"] = 5215548352;
    ["Dua Lipa - Pretty Please"] = 5215539201;
    ["Ariana Grande - 7 Rings"] = 5624503572;
}

for Name, AudioID in pairs(audioList) do
    local NewSound = Instance.new("Sound",SoundService)
    NewSound.SoundId = "rbxassetid://"..AudioID
    NewSound.Name = Name
    local Success,Val = pcall(function()
	    return NewSound.Loaded
	end)
    if Success and Val ~= nil then 
        NewSound:Play()
        NewSound.Stopped:Wait()
        NewSound:Destroy()
    else warn("Error") end  
end

I will try it out! Thanks for the help!

1 Like

Why is my AudioPlayer not working? I have a video which shows what is happening


When I try to activate my system for a carbon monoxide event, only the Text To Speech plays, not the AudioPlayer itself.

Setup of my Audio API
The sound is loaded and the AS_ALRT player is connected to the VoiceNACOutput, but nothing is happening.