Garry's Mod

Garry's Mod

3D Stream Radio
Grocel  [开发者] 2015 年 9 月 13 日 上午 6:45
[Help] Error: 2 | Can't open the file
The given path of the file is not valid.

If you try to play an online file:
- Do not forget the protocol prefix such as 'http://'
- Make sure the file exist at the given URL. It should be downloadable.
- Make sure the format is supported and the file is not broken. (See below.)

If you try to play a local file:
- Make sure the file exist at the given path.
- Make sure the file is readable for Garry's Mod.
- The path must be relative your "<path to game>/garrysmod/sound/" folder. (See below.)
- The file must be in "<path to game>/garrysmod/sound/" folder. (See below.)
- You can play mounted stuff in "<path to game>/garrysmod/sound/".
- You can not play sound scripts or sound properties.
- Make sure the format is supported and the file is not broken. (See below.)

Supported formats:
MP3, OGG, AAC, WAV, WMA, FLAC
*.WAV files must be not self-looping in game as the API does not support these.[github.com]

How local or mounted file paths work:
- If you have a file located "<path to game>/garrysmod/sound/mymusic/song.mp3" you access it with these urls:
* file://mymusic/song.mp3
* mymusic/song.mp3

- For files in "<path to game>/garrysmod/sound/filename.mp3" you get them like this:
* file://filename.mp3
* filename.mp3

- Files outside the game folder are forbidden to be accessed by the game.
- Do not enter absolute paths.
- Only people who also have the same file localed there, will be able to hear the music too.
- Create folders if they are missing.
最后由 Grocel 编辑于; 2016 年 2 月 17 日 上午 2:10
< >
正在显示第 1 - 15 条,共 36 条留言
amogus 2016 年 1 月 11 日 上午 8:42 
Thx^^
Aedremor 2016 年 1 月 20 日 下午 11:26 
I get this error when trying to play local mp3 files, some will play but most of them won't, why is this?
Grocel  [开发者] 2016 年 1 月 21 日 上午 10:03 
I guess that could be a bug of GMod. The GMod developers are trying a few things with BASS.dll to improve its MP3 support.

But could be also likely that you could just put in wrong pathes. Read the OP, if you didn't yet.
最后由 Grocel 编辑于; 2017 年 4 月 3 日 上午 6:19
Peekofwar 2016 年 2 月 16 日 下午 1:17 
The following sound is playable via the in-game sound browser (accessible via the sound icon in the Radio Creator settings:

Error 2: Can't open the file
URL: music/mp_coop_lobby_2_c1.wav

Same thing if it is file://music/mp_coop_lobby_2_c1.wav


This file works though: music/radio1.mp3
最后由 Peekofwar 编辑于; 2016 年 2 月 16 日 下午 1:31
Grocel  [开发者] 2016 年 2 月 16 日 下午 1:28 
Well that's a proper error report folks. :D

Your URL is valid, but the BASS API the game (and so the radio) can not read the file because it is self looping. Check OP.

As written in the OP:
引用自 Grocel
*.WAV files must be not self-looping in game as the API does not support these.

The Sound Browser uses source's sound engine to playback the sounds, that's why it works.
最后由 Grocel 编辑于; 2016 年 2 月 16 日 下午 1:48
Peekofwar 2016 年 2 月 16 日 下午 1:33 
So, is there a way to make it work? Or would I have to make an entirely new sound?
Grocel  [开发者] 2016 年 2 月 16 日 下午 1:39 
No, that can't be made to work without a new sound file. Make one and upload it some where public, so you wouldn't need to upload via the game. I suggest you to read the FAQ and the discussions before continuing, as all the stuff has be answered before.

You can't get around API borders.
最后由 Grocel 编辑于; 2016 年 2 月 16 日 下午 1:40
Wuzzle 2016 年 2 月 26 日 上午 8:27 
How would I add lots of songs all at once?
Grocel  [开发者] 2016 年 2 月 26 日 上午 8:40 
There is no way of mass adding, you need to add them one by one using the addon's playlist editor. Make sure that the songs can be played in the radio first. The OP says what you need to know for that.

You can also edit the files by hand if you need to.
最后由 Grocel 编辑于; 2016 年 3 月 1 日 上午 8:57
geznervik 2018 年 5 月 25 日 下午 8:17 
So uhh.. When I used YouTube, I get an error saying 'URL not valid'. I use certain songs and it allows them, but... Others it does not allow (I'm guessing the sound file is too big?) Anyways, I just wanted to know an answer. Like for example, the ROBLOX Sharknado Song! Very small file size, worked the first few times, but then later got screwed up and wouldn't work..
Why the hell is this happening? Does YouTube not count as a valid URL? I mean, I'm bein honest to God right now.. It's damn well not working.

Peace out, until I get an answer. At probably 3:00 AM. When I'm probably asleep.
Grocel  [开发者] 2018 年 5 月 26 日 上午 1:18 
@Alphys:
Please put in the URL and the error code in the report. The addon description says these things for a reason...

You probaly forgot got to add a https:// at the beginning. Youtube URLs are usually valid.

But please don't be one of those guys about Youtube.

As you seen there: https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/246756300/360671352684917592/

Youtube support is limited and an optin feature for a reason. I originally planed to remove it with the last big update, because the converter API was first unreliable and then broken later. I decided not to remove it, because I found a better API. Sometimes these are unreliable as well.

Because of the bad experiences with bad comments, of my radio being "♥♥♥♥" for not fixing impossible Problems, I desided put in an activate first system, so people are forced acknowledge that I can not fix Youtube problems for said reasons without going things from free to very expensive.

That worked out quite well for now.
最后由 Grocel 编辑于; 2018 年 5 月 26 日 上午 1:26
CTOG 2018 年 6 月 19 日 上午 12:38 
It worked better when i put the music folder in GarrysMod/sourceengine/sound. Put file://(foldername)/(song name).mp3 (or whatever format your song is for) the local path. BTW for me the garrysmod folder did not have a sound folder. So if that's the case for others, just make one. I hope i help anyone still having a hard time with this.
最后由 CTOG 编辑于; 2018 年 6 月 19 日 上午 12:41
CTOG 2018 年 6 月 19 日 上午 12:51 
Oh, and if you want to pick songs without retyping the path, on the radio screen go-to gamesounds/(music folder name) it work if you put the music folder in GarrysMod/sourceengine/sound
surytrap 2019 年 10 月 2 日 上午 5:23 
Error 2: Can't open the file
URL: http://fallout.fm:8000/falloutfm3.ogg

There was no file or content found at the given path
最后由 surytrap 编辑于; 2019 年 10 月 2 日 上午 5:24
🩸Bloodmoon Shard🩸 2021 年 4 月 7 日 下午 12:42 
I cannot listen to majority of radio files. Some work most of them don't. They have proper link and everything but they just won't work. It just gives me error 2 could not play stream https:// link here.
< >
正在显示第 1 - 15 条,共 36 条留言
每页显示数: 1530 50