The 3D Stream Radio is an spawn able scripted entity that allows you to play streams from the Internet in 3D world sound using gm_bass.
**- Server side playlists.
- Playlist browser built into entity.
- Supports *.pls-playlists.
- Stream tags support. (It shows you some informations about the playing song.)
- Wire support. (inputs and outputs)
- GM_BASS’ 3D world sound.
- And of course it plays music.
NOTES TO GM_BASS:
This addon uses a new version of GM_BASS, it’s called GM_BASS_EDIT.
I edited it, because the original can not be used shared.
The original could cause conflicts with the new one, because it uses an outdated library.
But you can install the edited version with it’s updated libraries (bass.dll and tags.dll) you can still use it like the original version,
that means no addons will brake (You would to have to change the module requisition to the new name, though). This and its source are included in the SVN.
You can read it’s documentation here: http://svn.xp-dev.com/svn/2d3d_Browser/gm_bass_documentation.txt
And the changes are listed here: http://svn.xp-dev.com/svn/2d3d_Browser/lua/includes/modules/gm_bass_edit_readme.txt
Download and Install:
You install this addon via SVN.
You create a new folder in you addons folder and then you checkout this link to the new folder: http://svn.xp-dev.com/svn/2d3d_Browser
After your download is finished you have to run the Install_Bass_Modules.bat to get this addon to work.
You will find it in the just downloaded addon, it puts the libraries (bass.dll and tag.dll) in the bass folder near the hl2.exe for you.
You can put *.pls-playlists to data\StreamRadio\Playlists, but you have to rename them from *.pls to *_pls.txt, so if you got a “music.pls” file then you rename it to “music_pls.txt”.
If you have problems please post or PM me a condump with your problem description.
If you just want the modified dll and/or source code you can get it here: http://svn.xp-dev.com/svn/2d3d_Browser/lua/includes/modules
Convars and Concommands:
[TABLE=“class: grid, width: 844”]
Sets the maximum count of radios that can have advanced wire outputs. Default: 5
Print’s the version and checks for updates.
Reloads all autorun scripts in lua/bass. Listenserver and admin only!
Reload the radio entity, it removes all radios on the map. Listenserver and admin only!
Prints _G.BASS and _R.BASSChannel.
[TABLE=“class: grid, width: 1085”]
Plays the Wire Channel when on 1 or greater else stop playing.
And set the Volume. Takes 0-1.
Set’s the Wire Channel, press the Wire Icon it or use the play input to play it.
Returns the name of the stream.
Returns the URL of the stream.
If you can use the outputs below (called “Advanced Outputs”) it returns 1 else it returns 0.
Returns 1 when playing or 0 when not.
Returns the time of playing in seconds.
Returns the length time of the stream in seconds. An endless stream has a length of 0.
Returns an array of 5 strings. These strings are the stream tags.
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.
Returns an array of 128 numbers, these go from 0 to 1. This is the sound spectrum.
Returns the sound level, this number goes from 0 to 32768 and has no decimal places.
Returns the error code. See at Error Codes below.
[TABLE=“class: outer_border, width: 350”]
-1 = Unkown Error
0 = OK
1 = Memory Error
2 = Can’t open the file
3 = Can’t find a free/valid driver
4 = The sample buffer was lost
5 = Invalid handle
6 = Unsupported sample format
7 = Invalid position
8 = BASS_Init has not been successfully called
9 = BASS_Start has not been successfully called
14 = Already initialized/paused/whatever
18 = Can’t get a free channel
19 = An illegal type was specified
20 = An illegal parameter was specified
21 = No 3D support
22 = No EAX support
23 = Illegal device number
24 = Not playing
25 = Illegal sample rate
27 = The stream is not a file stream
29 = No hardware voices available
31 = The MOD music has no sequence data
32 = No internet connection could be opened
33 = Couldn’t create the file
34 = Effects are not available
37 = Requested data is not available
38 = The channel is a ‘decoding channel’
39 = A sufficient DirectX version is not installed
40 = Connection timedout
41 = Unsupported file format
42 = Unavailable speaker
43 = Invalid BASS version (used by add-ons)
44 = Codec is not available/supported
45 = The channel/file has ended
- Grocel - For making the radio.
- AzuiSleet - For writing the binary module GM_BASS.
- Asholibus - For testing.
- Razor2143 - For testing.