Garry's Mod

Garry's Mod

Modding at its finest
Discover addons, save games, demos, and more, and add them to Garry's Mod with a click of a button. Want to create and share your own creations? Click here to learn how.
Breve 1 24 Dec, 2022 @ 7:28pm
WebSDR Radio Mod
There are many addons on the radio in the workshop, but they all use the livestream or just sounds from gamefolder...

I had an idea for a modification that would be able to support real-time playback of WebSDR broadcasts (A WebSDR is a Software-Defined Radio receiver connected to the internet, allowing many listeners to listen and tune it simultaneously).
This will create an opportunity to listen to the broadcast of REAL radio stations in the AM band.

As far as I understand, Java or HTML 5 support is required.
I am sure that there is nothing impossible in this. At least MediaPlayer supports flash and HTML 5.

The only question is to arrange everything beautifully and create a mod.
However, I've been designing and textures all my life and have very little programming experience. I need help.
< >
Showing 1-15 of 45 comments
Breve 1 24 Dec, 2022 @ 7:33pm 
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2891337724

Here, in workshop i found some nice models of Radio from past. It will be ideal for such mod, because this is also use AM.
Breve 1 24 Dec, 2022 @ 7:36pm 
Display design of radioreceiver should resemble this mod. I think this is a good solution.
You can tune the radio and then hide the display in the mod options and just enjoy listening.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=246756300
Grocel 80 25 Dec, 2022 @ 5:34am 
Don't use an an ingame browser to playback sound/music streams. It is slower, can crash the game, can be unsafe and does not work for every game version branch. The 3D Stream Radio uses sound.PlayURL() function for playback instead for that reason.

https://wiki.facepunch.com/gmod/sound.PlayURL

This function uses the BASS sound engine that ships with the game. It is quite powerful, but also limited. It can only support actuall sound streams such as mp3, wav, acc etc. BASS can not playback HTML5, videos or websocket content.

Also please don't underestimate the programming in a project, it usually makes up a major part of a project's development time. The 3D Stream Radio addon has like hundreds of progamming hours into it already.
Last edited by Grocel; 25 Dec, 2022 @ 5:35am
Breve 1 25 Dec, 2022 @ 1:40pm 
Originally posted by Grocel:
Don't use an an ingame browser to playback sound/music streams. It is slower, can crash the game, can be unsafe and does not work for every game version branch. The 3D Stream Radio uses sound.PlayURL() function for playback instead for that reason.

https://wiki.facepunch.com/gmod/sound.PlayURL

This function uses the BASS sound engine that ships with the game. It is quite powerful, but also limited. It can only support actuall sound streams such as mp3, wav, acc etc. BASS can not playback HTML5, videos or websocket content.

Also please don't underestimate the programming in a project, it usually makes up a major part of a project's development time. The 3D Stream Radio addon has like hundreds of progamming hours into it already.


Thanx for information.
Breve 1 25 Dec, 2022 @ 3:57pm 
I'm currently reading the gmod scripting wiki... In general, everything looks pretty clear and there is nothing too complicated. I remembered that once I had to work with scripts in Arma-3 and prescribe arrays of script commands myself ... I think I will succeed in Gmod too .... Let's see.
Breve 1 25 Dec, 2022 @ 4:11pm 
So, as far as I understand, the websdr control panel is a picture on which radio transmission lines are applied every second. Like an oscilloscope. And all this happens through HTML5.

Conclusion - I need to create a panel that can play a stream in html5, as well as an audio stream, and then attach it to the radio model.
Breve 1 25 Dec, 2022 @ 4:17pm 
Probably something like an in-game browser window is needed. Perhaps similar mods are available in the workshop. I have to find them and tinker with them to understand how it works...
Grocel 80 25 Dec, 2022 @ 4:19pm 
Please be sure you don't half ass your project though. I have seen a lot of ADHD-Projects that got canceled the first week, because it turned out to be much more work/complex than anticipated.

Using a panel for playing/rendering HTML5 is what I mean with unsing the ingame browser. It does not work with every game version branch, is unstable and can be slow and unsafe. On the "main" branch of the game the ingame browser is very outdated, so it is likely you will get some issues running the webpage on it.

I just want to make sure you can make informed decisions.
Last edited by Grocel; 25 Dec, 2022 @ 4:22pm
Breve 1 25 Dec, 2022 @ 4:22pm 
https://www.youtube.com/watch?v=AlfJG5sBYeI

I just found such video, where somebody use Google Chrome browser ingame, like display. And it's perfectly works...
But this mod not exist in Workshop. It may have been removed due to copyright or some such nonsense. Or maybe the author of the mod just didn't want to share it in the public domain... It's strange.

In any case, it works great and shows that everything is functioning stably.
Grocel 80 25 Dec, 2022 @ 4:25pm 
This is likely a dev test of an early project. In this particular case it is very outdated, the video is 13 years old.
Last edited by Grocel; 25 Dec, 2022 @ 4:27pm
Breve 1 25 Dec, 2022 @ 4:26pm 
Originally posted by Grocel:
Please be sure you don't half ass your project though. I have seen a lot of ADHD-Projects that got canceled the first week, because it turned out to be much more work/complex than anticipated.

Using a panel for playing/rendering HTML5 is what I mean with unsing the ingame browser. It does not work with every game version branch, is unstable and can be slow and unsafe. On the "main" branch of the game the ingame browser is very outdated, so it is likely you will get some issues running the webpage on it.

I just want to make sure you can make informed decisions.

I am a radio specialist by profession and I have always been attracted to the topic of radio. I tried to do something similar to this mod in other games before, but their engines were too primitive and incapable of rendering anything like html 5. Gmod is much more advanced in this regard. Too bad I found out about him so late.
You shouldn't worry about it. I am burning with this idea and therefore, I am unlikely to calm down until I create such a mod.
Grocel 80 25 Dec, 2022 @ 4:28pm 
Last edited by Grocel; 25 Dec, 2022 @ 4:30pm
Breve 1 25 Dec, 2022 @ 4:34pm 
Thanks for the links. They will help me.
And now I will try to poke around inside this media player.
In the original mod, there is a certain list of servers from where you can watch streams. It's youtube, reddit and twitch... I need to change this to a websdr window and attach to another model...

Now I will try to figure it out.

Originally posted by Grocel:
This might help you:

https://wiki.facepunch.com/gmod/Panel:SetHTML
https://wiki.facepunch.com/gmod/Panel:UpdateHTMLTexture

This addon runs with HTML5, so you can take a look at this:
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=546392647
< >
Showing 1-15 of 45 comments
Per page: 1530 50

Date Posted: 24 Dec, 2022 @ 7:28pm
Posts: 45