Custom Sounds Need Help

I’m wanting to create some sort of boombox/radio entity. I have made the following code and put the sounds in the following folders but i get the error.
Failed to load sound “addons\radio\sounds\musicbaby\songone.wav”, file probably missing from disk/repository
Failed to load sound “addons\radio\sounds\musicbaby\songtwo.wav”, file probably missing from disk/repository

Heres the layout of the addon

Addon Folder > https://gyazo.com/e616dba83ed959e90944cf70c2d36e1d

Inside Sounds > https://gyazo.com/4546ccd67c957f09ad1e0d479d968857

Inside musicbaby > https://gyazo.com/29762dff348ceddf31097193358dde89

Sv code:


AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
resource.AddFile("addons/radio/sounds/musicbaby/songone.wav")
resource.AddFile("addons/radio/sounds/musicbaby/songtwo.wav")
function ENT:Initialize()

	self:SetModel("models/props/cs_office/radio.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	self:SetUseType( SIMPLE_USE )
	local phys = self:GetPhysicsObject()

	if phys:IsValid() then

		phys:Wake()
	end
end

sound.Add( {
	name = "songone",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "addons/radio/sounds/musicbaby/songone.wav"
} )

sound.Add( {
	name = "songtwo",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "addons/radio/sounds/musicbaby/songtwo.wav"
} )

sound.Add( {
	name = "songthree",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "vehicles/enzo/idle.wav"
} )

function ENT:Use(caller, activator)
	local random = math.random( 1, 4 )
if random == 1 then

	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songone", self:GetPos() )
end

if random == 2 then
	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songtwo", self:GetPos() )
end

if random == 3 then
	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songthree", self:GetPos() )
end

if random == 4 then
self:StopSound( "songone" )
self:StopSound( "songtwo" )
self:StopSound( "songthree" )
end
end


If you have any idea to get around this error I’d be grateful if shared.
else: sorry for creating the messiest code of 2018
else: dont know if this matters but I am running the addon through a dedicated server not on my gmod directory

This might sound stupid but try replacing addons/radio/sounds/musicbaby/songone.wav with
addons/radio/sounds/musicbaby/songone.wav.wav and see if it works.

Edit: When I think about it, it might be sound not sound(s)

Changed the folder to sound and tried adding another .wav but nothing changes still get that error.

bump

Instead of doing this:



"addons/radio/sounds/musicbaby/songone.wav"


Try removing the “addons/radio/sounds” bit so it looks like this:



"musicbaby/songone.wav"


My guess is that the Sound.Add thing would be looking in



"sound/addons/radio/sounds/musicbaby/songone.wav"


With your first code

Changed it like you said but it just changes the error to
Failed to load sound “musicbaby/songone.wav”, file probably missing from disk/repository

Try changing the actual folder name the sound is in from ‘sounds’ to ‘sound’ - that seemed to get it to work for me

I’ve had the folder changed to sound since Invulved mentioned it
heres what i have now https://gyazo.com/740a689c1db5276183decef6546cc4b5

Well, have you tried doing the thing I said before since you changed it?

I tried that myself and I copied your folder structure and it worked for me… maybe your sounds aren’t 16 bit? They have to be 16 bit to work

Current Code:


AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
resource.AddFile("musicbaby/songone.wav")
resource.AddFile("musicbaby/songtwo.wav")
function ENT:Initialize()

	self:SetModel("models/props/cs_office/radio.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	self:SetUseType( SIMPLE_USE )
	local phys = self:GetPhysicsObject()

	if phys:IsValid() then

		phys:Wake()
	end
end

sound.Add( {
	name = "songone",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "musicbaby/songone.wav"
} )

sound.Add( {
	name = "songtwo",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "musicbaby/songtwo.wav"
} )

sound.Add( {
	name = "songthree",
	channel = CHAN_STATIC,
	volume = 1.0,
	level = 80,
	pitch = { 95, 110 },
	sound = "vehicles/enzo/idle.wav"
} )

function ENT:Use(caller, activator)
	local random = math.random( 1, 4 )
if random == 1 then

	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songone", self:GetPos() )
end

if random == 2 then
	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songtwo", self:GetPos() )
end

if random == 3 then
	self:StopSound( "songone" )
		self:StopSound( "songtwo" )
			self:StopSound( "songthree" )
sound.Play( "songthree", self:GetPos() )
end

if random == 4 then
self:EmitSound( Sound( "buttons/button16.wav" ), self:GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100 )
self:StopSound( "songone" )
self:StopSound( "songtwo" )
self:StopSound( "songthree" )
end
end


Current File Structure: https://gyazo.com/740a689c1db5276183decef6546cc4b5

The sounds are 16 bit and with all that I am still getting the error
Failed to load sound “musicbaby\songtwo.wav”, file probably missing from disk/repository

bump

this



resource.AddFile("musicbaby/songone.wav")
resource.AddFile("musicbaby/songtwo.wav")


should be this



resource.AddFile("sound/musicbaby/songone.wav")
resource.AddFile("sound/musicbaby/songtwo.wav")


Also I was under the impression that if you want to call ent:StopSound() then you must first have to call ent:EmitSound(), not just sound.Play at the ent’s position.

im a fucking idiot, file was more then 16mb