[B]About:[/B]
The 3D Stream Radio is an spawnable scripted entity that allows you to play streams from the internet and local files in 3D world sound. You spawn it with a tool, which allows you to change some settings of it too.
[B]Video:[/B]
[video=youtube;89oD8PW1Bvo]http://www.youtube.com/watch?v=P1avmNyiIYc[/video][video=youtube;89oD8PW1Bvo]http://www.youtube.com/watch?v=89oD8PW1Bvo[/video]
[B]Images:[/B]
[t]http://puu.sh/812kx.png[/t] [t]http://puu.sh/811Rh.png[/t] [t]http://puu.sh/812mx.png[/t]
[t]http://puu.sh/aitMw/d8d132bb94.png[/t] [t]http://puu.sh/aitPi/c813d23c9b.png[/t] [t]http://puu.sh/cxE3B/4ead111ef5.jpg[/t]
[IMG]http://puu.sh/cxEzv/194c336a36.png[/IMG] [IMG]http://puu.sh/bzaYy/ae2cddd81c.png[/IMG]
[B]Requirements: [/B]
Nothing. However Wiremod [url=https://github.com/wiremod/wire](GitHub)[/url] [url=http://steamcommunity.com/sharedfiles/filedetails/?id=160250458](Workshop)[/url] is highly recommended.
[B]Features: [/B]
- Serverside playlists
- Playlist browser built into entity
- Playlist support for *.pls, *.m3u, *.json and *.vdf
- Playlist support for these addons: [url=http://steamcommunity.com/sharedfiles/filedetails/?id=164070103]MX Radio[/url], [url=http://steamcommunity.com/sharedfiles/filedetails/?id=314470705]Web Radio[/url], [url=http://steamcommunity.com/sharedfiles/filedetails/?id=250792180]PatchPlay[/url]
- Model support for these addons: [url=http://steamcommunity.com/sharedfiles/filedetails/?id=605223544][NM] Prop Pack[/url], [url=http://steamcommunity.com/sharedfiles/filedetails/?id=529954000]Fallout 3 Jukebox Model[/url], [url=http://steamcommunity.com/sharedfiles/filedetails/?id=116592647]Minecraft SWEP[/url]
- Build-in playlist editor
- [url=http://steamcommunity.com/sharedfiles/filedetails/?id=160250458]Wiremod[/url] support (inputs and outputs, advanced wiremod support when the optional [url=http://facepunch.com/showthread.php?t=1472253]gm_bass3[/url] is installed on the server.)
- 3D world sound, which can be turned off
- Customizable GUI colors
- Multiple radio models
- FFT Spectrum visualizer
- [u]Limited[/u] Youtube support (uses the [url=http://youtubeinmp3.com/api/]YoutubeInMP3 API[/url])
- [url=www.soundcloud.com]SoundCloud®[/url] support
- CPPI support
- Duplicator support
- Supports local files (inside the [i]".../garrysmod/sound/"[/i] folder)
- Clientside performance settings
- An API for developers ([url=http://xp-dev.com/svn/2d3d_Browser/lua/streamradio_core/api.lua]Documentation, a kind of[/url]).
[B]Adding playlists:[/B]
[B]You use the playlist editor if you are admin.[/B]
The playlist files are stored on the server at [I]".../garrysmod/data/streamradio/playlists"[/I].
[B]Convars and Concommands: [/B]
[QUOTE]
[B]sbox_maxstreamradio <number>[/B]
- Set the maximum count of radios that can be spawned per player. Default: 20
[B]sv_streamradio_max_spectrums <number>[/B]
- Sets the maximum count of radios that can have advanced wire outputs such as FFT spectrum or song tags. -1 = Infinite, 0 = Off, Default: 5
[I][U]- Needs gm_bass3 installed on the server to work.[/U][/I]
[B]sv_streamradio_rebuildplaylists[/B]
- Recreates the default playlists.
[b]sv_streamradio_resetplaylists[/b]
- Deletes [I][U]ALL playlists[/U][/I] and recreates the default ones.
[B]info_streamradio_errorcode <number>[/B]
- Prints out the translation of the given error code.
[B]info_streamradio_version[/B]
- Shows the current version.
[B]test_streamradio_show_functions[/B]
- For Debugging: Prints a list of addon relevant functions.
[B]cl_streamradio_mute 0/1[/B]
- Mutes all radios when set to 1. Default: 0
[B]cl_streamradio_mutedistance <number>[/B]
- Mutes all radios which are further away than the given units. Min: 500; Max: 5000; Default: 2000
[B]cl_streamradio_drawdistance <number>[/B]
- Stops redrawing on radios which are further away than the given units. Min: 400; Max: 4000; Default: 1000
[B]cl_streamradio_spectrumdistance <number>[/B]
- Stops FFT spectrum redrawing on radios which are further away than the given units. Min: 250; Max: 2500; Default: 500
[B]cl_streamradio_showcursor 0/1[/B]
- Enables the cursor in the GUI when set to 1. Default: 0
[B]cl_streamradio_no3dsound 0/1[/B]
- Disables 3D sound for all radios when set to 1. Default: 0
[B]cl_streamradio_playlisteditor[/B]
- Opens the playlist editor. Only works, if you are an admin.
[/QUOTE]
[B]Wiremod:[/B]
[QUOTE]
[B]Inputs:[/B]
[B]Play [NORMAL][/B]
- Plays the Wire Channel when on 1 or greater else stop playing.
[B]Volume [NORMAL][/B]
- Set the Volume. Takes 0-1.
[B]Radius [NORMAL][/B]
- Sets the maximum distance of being hearable. Takes 0-5000.
[B]Loop [NORMAL][/B]
- Makes the stream loop on 1 or greater when it's not an endless stream.
[B]3D Sound [NORMAL][/B]
- Enable 3D Sound on 1 or greater. It's on by Default.
[B]Stream URL [STRING][/B]
- Set's the Wire Channel, press the Wire Icon or use the play input to play it.
- Can be online and offline paths
- Offline paths are relative to GMod's sound folder.
[/QUOTE]
[QUOTE]
[B]Outputs:[/B]
[B]Stream Name [STRING][/B]
- Returns the name of the stream.
[B]Stream URL [STRING][/B]
- Returns the URL of the stream.
[B]Play [NORMAL][/B]
- Returns 1 when in playing mode or 0 when not.
[B]Mode [NORMAL][/B]
- Returns 0 when in showing playlist files.
- Returns 1 when in showing playlist entries.
- Returns 2 when in playing mode.
[B]Volume [NORMAL][/B]
- Returns its volume, it goes from 0 to 1.
[B]Radius [NORMAL][/B]
- Returns its maximum distance of being hearable. The number can be between 0 and 5000.
[B]3D Sound [NORMAL][/B]
- Returns 1 when the 3D sound is on.
[B]Advanced Outputs [NORMAL][/B]
- If you can use the [U]outputs below[/U] (called "Advanced Outputs"), it returns 1 else it returns 0.
- [U]It will be always off when gm_bass3 is not installed on the server.[/U]
- It is off when the count of playing radios exceed the ConVar "sv_streamradio_max_spectrums".
[B]Playing [NORMAL][/B]
- Returns 1 when playing or 0 when not.
[B]Play Time [NORMAL][/B]
- Returns the time of playing in seconds.
[B]Stream Length [NORMAL][/B]
- Returns the length time of the stream in seconds. An endless stream has a length of 0.
[B]Stream Tag [ARRAY][/B]
- Returns an array of 5 strings. These strings are the stream tags.
[B]Stream Codec [ARRAY][/B]
- Returns an array of 2 numbers and a string.
- The first number is the sample rate, second is the sample size and the string is the format.
[B]Spectrum [ARRAY][/B]
- Returns an array of 128 numbers, these go from 0 to 1. This is the FFT sound spectrum.
- The first value of the array is set to "Standby mode: Connect to this Output to aktivate it." when it is not connected.
- In the GMod Wiki are some tips for further processing.
[B]Sound level [NORMAL][/B]
- Returns the sound level, it goes from 0 to 1.
[B]Stream Error [NORMAL][/B]
- Returns the error code.
[B]Stream Error Text [STRING][/B]
- Returns the error as a string.
- Returns -1 when not connected.
[/QUOTE]
[QUOTE]
[B]Wirelink:[/B]
If you want to use Wirelinks, don't use the entity:wirelink() function in E2.
Add the Wirelink output to the radio with the Wire tool and connect it to your E2 instead, so the radio recognizes the Wirelink to be connected.
[/QUOTE]
[B]Download:[/B]
Steam Workshop: [URL]http://steamcommunity.com/sharedfiles/filedetails/?id=246756300[/URL]
SVN: [URL]https://xp-dev.com/svn/2d3d_Browser/[/URL]
[url=https://garrysmods.org/download/57676/3d-stream-radio][img]https://garrysmods.org/download/57676/button.png[/img][/url]
[B]Gm_bass3:[/B]
It is optional for server (Advanced Wiremod Outputs) and client.
[URL]http://facepunch.com/showthread.php?t=1472253[/URL]
[B]Credits:[/B]
Code: Grocel
Models: SligWolf
yes, grocel is back in the bussiness(after the bass module in gmod 12 that was fantastic)
yeah i will add it on my server, but i need a mute function clientside
Sure, I will add a clientside mute function later.
Update:
[QUOTE]Trying to fix: lua/weapons/gmod_tool/stools/streamradio_color.lua:9: attempt to call field 'GetDefaultColors' (a nil value)
Fixed the theme tool not shooting on right click.
Fixed the theme tool preview not showing the right colors of the info entries.
Added Bass_ShowErrorInfo <err> Concommand to translate an error code a string.[/QUOTE]
It's very good, I installed it on our server, made a quick test of all possibilities and found only one bug yet: I had to shoot the color tool twice for the colors to be updated.
Tried with a Shoutcast stream, you must input [url]http://ip:port[/url] (can be found in the .pls of the radio) as the stream url.
And yes a client option Mute (or Disable), is needed. I would prefer if the Mute button didn't just set volume to 0 but instead completely stop downloading the stream (few people including me, have slow internet and are happy to save some bandwidth).
I just did an update:
[QUOTE]- Added a way to mute the radio clientside.
- Added several performance settings to a new menu at utilities.
- Added ConVars for these settings:
* cl_streamradio_mute 0/1 (Default: 0), Mutes all radios when set to 1.
* cl_streamradio_mutedistance 500-5000 (Default: 2000), Mutes all radios which are further away than the given units.
* cl_streamradio_drawdistance 400-4000 (Default: 1000), Stops redrawing on radios which are further away than the given units.
* cl_streamradio_spectrumdistance 250-2500 (Default: 500), Stops FFT spectrum redrawing on radios which are further away than the given units.[/QUOTE]
The mute is done by stopping a stream and restarting it after unmuting.
maybe i found a bug. Look at this... In first 5 Minutes of joinen, you can see the Radio. But then...
just look at the screen.
Stats
Debian 7
Not running that Bass mod
DarkRP gamemode
~50 players online
[URL="http://i.imgur.com/LiYgFgS.jpg"]Image[/URL]
A bug with the render target it is using. I think I'm going to remove it anyway, because I noticed some other glitches with it too.
Maybe someone knows how to fix the render target probably, so I don't have to remove it.
I think it's the same bug than with wiremod's screens. It's caused when there is a huge lag, all the screens stop working. They "solved" it by adding buttons "Refresh" in a control panel, to recreate the render targets (I think)
But if you remove it, how we select radios then ?
Also, some radios are very quiet with max volume, I would like to be able to increase the volume, so what about making it twice louder, and add another client setting that would divide the radio's volume... I dont know how to explain clearly so, for example:
Radio volume = 1 and client volume = 1 -> client hear the maximum volume of that radio
Radio volume = 0.5 and client volume = 0.5 -> client hear 1/4 of the maximum volume of that radio
Also if you could make it so when spawning a radio it would directly apply the colors settings to it
The problem is that bass can't get louder, so a global volume slider is not worth it. When I remove the render target, the display will be just drawn without it. About the color thing, I would do it later maybe. A playlist editor is planed to be added, but that has to wait a bit too.
I have an idea for rendertarget fixes. Draw a control pixel at 1,1 or something and then clientside scan for the color there, if it doesnt' exist then rebuild rendertargets.
There is another glitch, when the radio is in a mirror room:
The render target starts to flicker around. If you look at the radio in the mirror the glitch is gone.
The frame rate of the radio display is locked to 40 fps. When my game is running at less, the display turns black and the mirror one is drawn correctly if it the only visible.
[URL]http://puu.sh/8eSA9.mp4[/URL]
and what about a derma? with +IN_USE or something
edit: Is there a way to Set the Volume louder?
[QUOTE=shadowman110;44587548]and what about a derma? with +IN_USE or something
edit: Is there a way to Set the Volume louder?[/QUOTE]
The derma would make things more complicated and you would be able to click on it with the mouse on screen, where the invisible panel would be, causing unwanted behaviours. It wouldn't solve the rendertarget problem either. It would be still drawn on a rendertarget.
Also:[QUOTE=Grocel;44587225]The problem is that bass (build into GMod) can't get louder...[/QUOTE]
This new update should fix that black screen after huge lags:
[QUOTE]- Added "Liquid Dubstep" to the playlists.
- Playlists with just one entry are played directly after opening now.
- Cleaned up the GUI and made it easier to read.
- Added a whole punch of clientside settings.
- Hopefully fixed a render target issue that occurs after big lags.
[/QUOTE]
The glitches with mirrors are still there. Is that a bug with GMod or is fixable in Lua?
[QUOTE=Grocel;44604320]This new update should fix that black screen after huge lags:
The glitches with mirrors are still there. Is that a bug with GMod or is fixable in Lua?[/QUOTE]
It's a bug with Source mirrors. They have quite a few issues.
I tried to use VLC to stream a mp3 over http.
I can access my stream with a web browser, and it's working fine with the PlayX addon, when I choose "mp3" as provider.
But if I try to use that url in your Radio, it says Invalid stream url.
Any idea why?
That error string is just a place holder because GMod Bass functions aren't returning the errorcode yet. There should be a red message in the console about a Bass streaming error. There should an errorcode number, can you tell me that?
Also, you if you want to look up the meaning of that error number yourself, you can enter info_streamradio_errorcode <number> into the console.
This is so weird... Now it doesn't work with PlayX but work with your radio :S. I just don't understand.
Does PlayX use GMod Bass bindings yet?
Can you add a looping function?
[QUOTE=Grocel;44661451]Does PlayX use GMod Bass bindings yet?[/QUOTE]
I don't know... PlayX just refuse to play my stream. I find it very erratic, only good to play from youtube.
I found 2 bugs with the wire IO.
1) I like to do "wireless" things. So for example with Expression2:
[code]
@name test_streamradio
Radio = entity():isWeldedTo():wirelink()
Radio["Play", number] = 0
Radio["Stream URL", string] = "http://blabla/song.mp3"
Radio["Play", number] = 1
[/code]
Spawn the E2 on the radio: it doesn't attempt to play, it just do nothing.
The only way to solve it is to first link the "Stream URL" input of the radio, to a Wire Constant Value (even if it's a empty string) or whatever, and then spawn the E2 on the radio. Only then it will attempt to play the URL defined in the E2.
2) Most of the time, the advanced outputs will work for only few seconds, then they just stop updating.
Can you solve this ?
Also a request: Since the radio always display the audio spectrum, with or without the gm_bass2 module, can't you just enable the Spectrum output when the module is not installed?
[QUOTE=Monkah;44663165]Can you add a looping function?[/QUOTE]
Done in this update.
[QUOTE]
- Added looping mode.
- Fixed the Radio when you are using E2 Wirelink.
[/QUOTE]
[QUOTE=DEFCON1;44671589]1) I like to do "wireless" things.[/QUOTE]
Fixed, it was caused by an is wired check, but expect glitches with the wire button when you remove the E2.
[QUOTE=DEFCON1;44671589]
2) Most of the time, the advanced outputs will work for only few seconds, then they just stop updating.
[/QUOTE]
I will have to look at this later.
[QUOTE=DEFCON1;44671589]Also a request: Since the radio always display the audio spectrum, with or without the gm_bass2 module, can't you just enable the Spectrum output when the module is not installed?[/QUOTE]
You can't, because the Wiremod stuff is serverside, GMod Bass bindings are clientside only at the moment.
[QUOTE=Grocel;44678093]
Fixed, it was caused by an is wired check, but expect glitches with the wire button when you remove the E2.
[/QUOTE]
Thanks
[QUOTE=Grocel;44678093]
I will have to look at this later.
[/QUOTE]
I think it only do that with songs file, like when you play a mp3 from a file host such as solidfiles. I don't have this problem with the included radios. When it happen, the "Playing" output is set to 0, but the song is still playing.
Another bug with duplicators.
1) The colors aren't saved when the radio is duplicated or saved/loaded with Adv Duplicator 2.
2) When using Adv Duplicator 1 for just duplicating, everything is OK, but if you save and load, the display will not be visible at all.
Well, I couldn't replicate these duplicator bugs. Maybe I just fixed it now by fixing something else.
No it wasn't fixed, here is a video:
[url]http://s9.sfcdn.in/ODAwY2YxYjdhZGM3N2FhOGRkMTI2ZDkzMGE4YjkzOTczNTg1MDk0YjoxV2ZhbkM6MHg5V3hPYmV3NnNqMVVyOURtVW1EYkhEQ0Jv/cfb6e77d40/gm_flatgrass_2014-4-30_22-02-38.webm[/url]
I don't have an idea what is causing it. It works fine for me. Does anyone else have that problem?
Do you have addons installed that could be conflicting with or changing something on the dupesystem or the radio? And there are no Lua errors?
Ok I did more tests. It works fine in single player. Those bugs (adv duplicators bugs, and having to shoot twice with the Color tool) are only happening when I play in my dedicated server. I have disabled every addons but the Radio and Adv Duplicator 1 and 2, and there is no Lua error.
Also since recently, "rename.bat" is showing in the main menu of the radio (only in single player)
And can you make the radio spawn higher (at eyes level), and really frozen? Currently it spawn frozen but will unfreeze when something touch it.
That rename.bat thing is something in the SVN version, I use it to rename the playlist files to *.txt. It should be gone now. You would have to remove the folder from the data/streamradio/playlists folder manually, though. It was found as folder because there are some issues with GMod file API.
I think, I know what the issue with the dupe is and I will fix it soon. Maybe I will change that spawning too.
What's gm_bass2 used for on the server?
Sorry, you need to Log In to post a reply to this thread.