EmitSound issue

So I’m working on this thing, and it requires a sound to be played on a particular event. Now whenever the sound is supposed to be played, I get this lovely error [lua] Create Stream Failed error 41
Failed to load sound “swc\level.mp3”, file probably missing from disk/repository[/lua]
Obviously, I know that it’s trying to tell me that I do not have the file, yet it is both in my server files, and my default gmod files. Any ideas?

PS: I’ve just tested, and if I change the sound URL to “level.mp3” instead of “swc/level.mp3” it works.

What code you use to play, and what folders is the sound in on your client?

Here’s a TTT End Round Music system; EmitSound uses the same paths, this should hopefully show how to set up sounds, where to put them, how to resource.AddFile them, and how to play them.

Check those 4 things using this as a reference: https://dl.dropboxusercontent.com/u/26074909/tutoring/_zipped_code/acecool_ttt_end_round_music.rar

My sound was like this “sound/swc/level.mp3”

What is the Hz of the audio? It should be at 44100 Hz or it won’t play. You would get a different error if that were the case though.

Is the file also on your pc? It could be that your client is trying to download it, yet it is failing ( source makes it look like you’re downloading missing files because it still establishes a connection for the file, etc ).

Can you show us the code you use to transfer the file? Can you show us your FastDL setup if you have it? Have you restarted the game since downloading the file? Have you looked at my addon for the purpose of seeing how/where audio files should be located in the content directory? Does the audio file have any data; blank files are known to cause “File not found” errors, at least with Lua files.

It plays fine as long as the file is only in the sound folder, if it’s in a folder within the sound folder it doesn’t play. And I make it so that both my PC and the server files have it in the exact same directory.

As for the code to transfer the file, I don’t use any resource.AddFile, I simply transfer both the files on both PC and server files, in same directories. It works if the above condition is met.

Ok, your error says “Failed to load sound “swc\level.mp3”, file probably missing from disk/repository” but the code you pasted uses /… Did you use \ anywhere? If so, it is parsing the string as swcevel.mp3 with \l not meaning anything.

Strings seem to be parsed in Lua because of the pattern system; I wish the language was more like PHP and let us use 's for STRICT strings, and " for parsed strings. It’d increase the speed of running Lua because there would be a LOT less work for every non-parsed string to have to do.

Maybe I’ll submit this since Lua needs to be compiled into GMod, maybe it can be added.

I only use /
It also gives me a Create stream error before giving me the missing file error.


This person claimed to have same issue; but they didn’t set up FastDL correctly. Are you sure the downloads are actually downloading? Does it act like it downloads the same file each time ( dead give-away that it isn’t downloading )?

As I said, I do not use FastDL, I believe that if I simply have the files on PC and server it’d do the job. Again, it only does not work if the sound I’m trying to play is in a folder within the sound folder.

Did you try this yet: https://dl.dropboxusercontent.com/u/26074909/tutoring/_zipped_code/acecool_ttt_end_round_music.rar ??

Can you provide the other information we asked for? Can you provide a link for the audio file and post the script?