gm_bass_edit - The improved gm_bass.

The module gm_bass was originally made by AzuiSleet and got major edited by me with his permission.

Gm_bass2 hooks into a third party sound engine called BASS by the un4seen organization and its plug-ins.
Using this module will make you able to stream various formats of sound and play them as 3d world sound.

This is outdated. You should use gm_bass3 instead.

Why did you edit it and what did you change?
My changes are:
**- You can use gm_bass2 shared now! (This means it can also be used to get stream informations serverside while it is also used clientside.)

  • Added AAC, FLAC, MOD support.

  • Added support for the filesystem of GMod.

  • Made use of GMod’s BASS.

  • Improved the GMod Window check, so you can also use it on a dedicated server.

  • Warning: It’s not compatible with the old gm_bass any more! Read the SVN Change logs or this thread for more infos.

  • Renamed almost all functions, please read the documentation below.
    **

  • Made BASS always silent serverside.

  • Updated the bass and plug-in libraries.

  • Changed error outputs on loading errors.

  • Changed sound fading.

Added:

  • channel:IsValid(), channel:IsPaused() and channel:channel:IsStalled().

  • string = BASS.DecodeErrorCode(number), gives out the description of an error code.

  • table = BASS.Plugins, it’s a table of the loaded plugins. The key is the name and the value is the version.

  • two optional boolean arguments to BASS.StreamFile(), the 1st one is for 3d playing (false/nil = on) and the 2nd is for loop playing (true = on).

  • a optional boolean argument to BASS.StreamFileURL(), it is for 3d playing (false/nil = on).

  • a optional bool argument to channel:Play(), true makes the channel restart.

  • all fft* function BASS supports

    • Changed how are the channel:fft*() functions are working, it takes a table that gets changed now, instead of creating a new one each time.
  • number = BASS.Version, that’s number of the BASS version.

  • number = BASS.ModuleVersion, that’s number of the BASS version.

  • number = channel:getfrequency(), that returns the sample rate in Hz.

    • number = channel:getsample(), that returns the sample size in Bit.

    • string = channel:gettype(), that returns the format as a string.

    • number = channel:getvolume(), that returns the volume. (clientside)

    • Added nil = channel:set3dfadedistance(number distance), sets the distance the sound begins to fade. (clientside)

    • Added nil = channel:set3dcone(number innerangle, number outerangle, number outvolume)

      • Sets the cone of the sound, in the inner angle the sound is played at max volume, out of the outerangle the sound is played at the given (outvolume) volume. (clientside)

Removed:

  • BASS.SetPosition(), not needed anymore.
    • channel:setvolume() serverside.
    • channel:channel_set3dposition() serverside.
    • the 2nd argument of BASS.StreamFile(), it was a number that set the time offset. It never worked and could cause crashes.

Documentation:
gm_bass_documentation.html

Downloads:
Windows Binaries (Source included)

What do you mean with
“- You can use gm_bass_edit shared now!”

People dont need to download bass.dll, to use it on specific servers?

Hell… thats what we need

I think it means it can be used on both client and server, so it is still needed on the client.

No, it just can be used on servers too. It’s needed to get stream informations such like tages, sound level or spectrum. Streams are muted serverside so servers will not start to play music, if you open a stream with it. :v:

Good thing this got updated I was planning on creating a plugin for exclserver for streaming music.

Can’t garry just please spend 1000 euros out of his millions get this damn bass license and ship this with GMod.

Do any of you know, if you are able to put these third party dlls (bass.dll and tags.dll) into the gmod module?

Can you rephrase that question.

He wants to put the additional required DLLs into the module itself.

Yes you probably could compile bass.dll and tags.dll as a static library so they’re included into the module itself.

Are *.lib files static libraries?
Also I don’t have the source code of bass.dll and tags.dll, because they are closed source.
Do I need the source code to compile it as a static library?

Yes. You’d need to recompile them so yes you’d need the source code.

Would there be anyone willing to help me compile a Linux Shared Object/Binary of gm_bass?

Unfortunately I don’t know how to compile for Linux/Mac, since I don’t know/own/want Linux/Mac. It would be truly nice if someone could compile a Linux/Mac build for us.

Which language did you compile the dll in?

c++, obviously.

Lua

:suicide:

I just updated the module, here are the changes:

  • Updated the bass and plugin libraries.

  • Added AAC, FLAC and MIDI plugins.

  • Added 2 optional boolean arguments to BASS.StreamFile(), the first one is for 3d playing (false/nil = on) and the second is for loop playing (true = on).

  • Added a optional boolean argument to BASS.StreamFileURL(), it is for 3d playing (false/nil = on).

  • Added a optional bool argument to channel:play(), true makes the channel restart.

  • Added table = channel:fft256(), it does the same as channel:fft2048(), but the table has 128 indexes.

  • Added table = channel:fft512(), it does the same as channel:fft2048(), but the table has 256 indexes.

  • Added table = channel:fft1024(), it does the same as channel:fft2048(), but the table has 512 indexes.

  • Also some code cleanup.

I also have a question to you:
Today, I have seen that the developers of GMod Tower somehow managed to load the gm_bass modules (bass.dll, tags.dll, bassmidi.dll, etc.) right from the addon’s lua/includes/module folder just a few weeks ago.
So I would like to know how they done this, because it would be also useful for me. Can someone explain this to me?

Yeah, in that post it makes it seem like that the binary modules load from the addon folder but I thought you couldn’t do that…
If there is a way to do that it would be less confusing for people installing addons with binary modules in them, but then again its a way to trick people into installing malicious files by hiding it in an addon :stuck_out_tongue:

You can load GMod binary modules (gm_bass.dll) from the addons folder for a while. What I want to know is: How do I load the third party modules (bass.dll, tags.dll) which aren’t GMod modules from elsewhere than the exe’s folder.