Skip to content

Wiremod input and outputs

Grocel edited this page Nov 14, 2023 · 13 revisions

This list below will tell you about the functionalities of the Wiremod input and outputs of the radio entity. Keep in mind that it is not a tutorial, so it requires some of knowledge of Wiremod in general. If you are new to Wiremod, you should become familiar with the basic mechanics of Wiremod first. I also recommend to know some stuff about E2 as well.

Wiremod download

Inputs

  • Stream URL [STRING]

    • Set's the wire stream, press the wire icon or use the play input to play it.
    • It's an URL. See FAQ for more details.
  • Play [NORMAL]

    • Plays a stream when on 1 or greater else stop playing.
  • Pause [NORMAL]

    • Pauses the stream when on 1 or greater else resume.
  • Mute [NORMAL]

    • Mute the stream when on 1 or greater else unmute.
  • Volume [NORMAL]

    • Set the Volume.
    • Takes 0-1.
  • Radius [NORMAL]

    • Sets the maximum distance of being audible.
    • Takes 0-5000.
  • Loop Mode [NORMAL]

    • When set to 0 the song will stop at the end.
    • When set to 1 the song loops indefinitely.
    • When set to 2 the playlist loops indefinitely.
  • Time [NORMAL]

    • Sets the playback time position to the given value in seconds.
  • 3D Sound [NORMAL]

    • Enable 3D sound on 1 or greater. It's on by default.
  • Disable Display [NORMAL]

    • Disable the GUI display on 1 or greater. It's enabled by default.
  • Disable User Input [NORMAL]

    • Disable user input via GUI on 1 or greater. It's enabled by default.
  • Disable Spectrum Visualizer [NORMAL]

    • Disable rendering the spectrum Visualization on 1 or greater. It's enabled by default.
  • Play Previous [NORMAL]

    • Play previous item of the current playlist when triggered.
  • Play Next [NORMAL]

    • Play next item of the current playlist when triggered.
  • Master Radio [ENTITY] (For synchronizing radios)

    • Set the master radio entity to synchronize from.
    • See section "Connecting radios together".

Outputs

  • Play [NORMAL]

    • Returns 1 when in playing mode or 0 when not.
  • Pause [NORMAL]

    • Returns 1 when in pause mode or 0 when not.
  • Stopped [NORMAL]

    • Returns 1 when in stop mode or 0 when not.
  • Muted [NORMAL]

    • Returns 1 when the stream is muted or 0 when not.
  • Volume [NORMAL]

    • Returns its volume, it goes from 0 to 1.
  • Radius [NORMAL]

    • Returns its maximum distance of being audible.
    • Gives 0-5000.
  • Loop Mode [NORMAL]

    • Returns 0 when the song stops at the end.
    • Returns 1 when the song loops indefinitely.
    • Returns 2 when the playlist loops indefinitely.
  • Loops Song [NORMAL]

    • Returns 1 when the song loops indefinitely.
  • Loops Playlist [NORMAL]

    • Returns 1 when the playlist loops indefinitely.
  • Playlist Item Count [NORMAL]

    • Returns count of current playlist items.
  • Playlist Pos [NORMAL]

    • Returns position of the current playlist item.
  • Playlist Names [ARRAY]

    • Returns array of playlist item names.
  • Playlist URLs [ARRAY]

    • Returns array of playlist item URLs.
  • Time [NORMAL]

    • Returns the playback time position as seconds.
  • Length [NORMAL]

    • Returns the stream length as seconds.
    • A value of -1 means endless stream.
  • Ended [NORMAL]

    • Returns 1 when the stream has ended.
  • 3D Sound [NORMAL]

    • Returns 1 when the 3D sound is on.
  • Stream Name [STRING]

    • Returns the name of the stream.
  • Stream URL [STRING]

    • Returns the URL of the stream.
  • Error [NORMAL]

    • Returns the error code for the server side stream.
    • Returns 1001 if Advanced Outputs are disabled.
  • Error Text [STRING]

    • Returns the error as a string.
    • Returns "Advanced outputs are disabled" if Advanced Outputs are disabled.
  • This Radio [ENTITY] (For synchronizing radios)

    • Returns the radio entity for synchronizing.
    • See section "Connecting radios together".
  • Advanced Outputs [NORMAL]

    • It returns 1 if you can use the outputs below (called "Advanced Outputs"), otherwise returns 0.
    • Only active when enabled via the Streamradio tool.
    • It will be always off when GM_BASS3 is not installed on the server.
    • It is off when the count of radios with advanced outputs enabled exceed the ConVar sv_streamradio_max_spectrums.

Advanced Outputs (needs GM_BASS3 installed on the server)

  • Playing [NORMAL]

    • Returns 1 when playing serverside or 0 when not.
  • Loading [NORMAL]

    • Returns 1 when loading serverside or 0 when not.
  • Meta Tags [ARRAY]

    • This is disabled at the moment (WIP)
  • Codec [ARRAY]

    • 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.
  • Spectrum [ARRAY]

    • 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 activate it." when it is not connected.
    • In the GMod Wiki there are some tips for further processing FFT data.
  • Sound level [NORMAL]

    • Returns the sound level, it goes from 0 to 1.
    • In the GMod Wiki there are some tips for further processing the sound level value.

Wirelink

The radio entity supports Wirelinks, including the entity:wirelink() function in E2.

Connecting radios together

You can connect radios (and so speakers as well) to other radios/speakers by using the "Master Radio" input.

Usage:

  • Connect "Master Radio" to "This Radio", no need for additional connections.
  • Connections can be done via a gateway like as an E2 as well. Wiremod mechanics apply.
  • While it is synchronizing its states are always set as same as the master states
  • While it is synchronizing you can not change the stream nor change its playing state manually or via Wiremod.
  • Disconnect this input to disable synchronization again.
  • Connecting a non-radio or an invalid entity disables the synchronization.
  • Creating a cycle or a connection to itself disables the synchronization for all involved radios.
  • The volume, radius and 3D sound are not synchronized by intention and can still be changed.

What is GM_BASS3?

It is an optional binary module for server (Advanced Wiremod Outputs) and client.

GM_BASS3 Download