Garrys mod can not locate custom sounds

Here is my code


local function PlayMusic(wintype)
   if wintype == WIN_INNOCENT then
      BroadcastLua('surface.PlaySound("ttt/weed.wav")')
   else
      BroadcastLua('surface.PlaySound("ttt/weed.wav")')
   end
end
hook.Add("TTTEndRound", "MyMusic", PlayMusic)
 
local function PlayStartMusic()
    BroadcastLua('surface.PlaySound("ttt/weed.wav")')
end
hook.Add("TTTBeginRound", "MyStartMusic", PlayStartMusic)

This lua file is in the lua/autorun/server location.

The code to download the files is:


resource.AddFile("sound/ttt/weed.wav");

Basically I was browsing around trying to find out how to make custom sounds play on my server for when terrorist and innocents win(…the files are the same because I wanted to test it out first…). I found this code,and it works but it gives me Failed to load sound “ttt/weed.wav”, file probably missing from disk/repository. I have put the sound files in sound/ttt/weed.wav . The files are being downloaded. I Have tried opening the file in audacity and then setting the sample rate to 44kHz and also saving it as PCM 16bit WAV. I still got that error and can not find out what I did wrong.

[lua]
local function PlayMusic(wintype)
if wintype == WIN_INNOCENT then
BroadcastLua(“surface.PlaySound(“ttt/weed.wav”)”)
else
BroadcastLua(“surface.PlaySound(“ttt/weed.wav”)”)
end
end
hook.Add(“TTTEndRound”, “MyMusic”, PlayMusic)

local function PlayStartMusic()
BroadcastLua(“surface.PlaySound(“ttt/weed.wav”)”)
end
hook.Add(“TTTBeginRound”, “MyStartMusic”, PlayStartMusic)
[/lua]

You should net library for this, BroadcastLua has limit of 255 bytes/characters.

Just to let you know I am new to lua. Also thank you ollie for your help, but i am still getting that error in console: Failed to load sound “ttt/weed.wav”, file probably missing from disk/repository .