GS - Radio
An asset for TMC's gaming platform on @godotengine that allows server owners to host a live radio on the server. Users may listen in with in-game commands or key bindings. Administrators may upload sounds/music through workbench's control panel.

An in-game radio for a game server. The operator uploads MP3 and OGG tracks through a small admin page (or the JSON API). The server plays them as one station, and every player who tunes in hears the same track at the same point. Design notes: docs/design.md.
Licensing: this addon only provides upload functionality. It ships no audio and does not supply, license or check the rights to any music. Operators supply their own audio and are responsible for having the right to broadcast it.
Install
- Get Godot 4.7.
- Either use gs-bootstrap, which clones every project and links the addons, or copy
addons/gs_radio/and gs-core'saddons/gs_core/into your project and enable gs-radio in Project > Project Settings > Plugins.
Server
var radio := GSRadioHttp.new()
radio.start_from_config(GSRadioHttp.read_config()) # the radio: block of cfg/server.yml
# in _process:
radio.poll()
radio:
enabled: true
bind: 127.0.0.1
port: 8791
token_file: /etc/gs/radio.token
max_track_mb: 20
upload_timeout_sec: 120
| Key | Default | Meaning |
|---|---|---|
enabled |
off | The radio does nothing unless set to true. |
bind |
127.0.0.1 |
Loopback only. Change it when a proxy or TLS is in front. |
port |
8791 | HTTP port. |
token_file |
none | File holding the admin token. The token is never read from the yml, environment or command line. |
max_track_mb |
20 | Largest upload in megabytes. |
upload_timeout_sec |
120 | Seconds to wait for an upload. |
Open http://127.0.0.1:8791/, paste the token and drop files. Admin routes need Authorization: Bearer <token>.
| Routes | Who |
|---|---|
GET /now, GET /tracks, GET /track/<id> |
Anyone |
POST /api with {"op": ...}, GET|POST /api/<op>, PUT /api/tracks/<file name>?title=&artist= (raw body), DELETE /api/tracks/<id> |
Admin |
curl -T song.mp3 -H "Authorization: Bearer $(cat radio.token)" "http://127.0.0.1:8791/api/tracks/song.mp3?title=Song"
| Ops | Who |
|---|---|
now, tracks, playlist, request, rate |
Listeners |
upload, delete, edit, reorder, playlist_add, playlist_remove, queue, dequeue, clear_queue, skip, mode, start, stop |
Admin |
To share another GSHttpServer instead of opening a second port, call radio.mount(server, "/radio").
Client
var radio := GSRadioClient.new()
radio.base_url = "http://server:8791"
radio.sink = GSRadioSinkGodot.new() # then radio.sink.attach(self)
add_child(radio)
Playback starts only when the player presses the toggle key.
| Action | Default key |
|---|---|
radio_toggle |
F8 |
radio_mute |
F9 |
radio_volume_up / radio_volume_down |
Page Up / Page Down |
The actions are added to the InputMap only if your project has not defined them, so players can rebind them. GSRadioCommands adds !radio, !song, !request <title> and !rate up|down to any command registry with add_command(name, help, fn).
Web builds work: files are fetched with HTTPRequest, and the public routes allow any origin.
Testing
Link gs-core into addons/, import the project once, then run examples/radio_selftest.tscn headless with Godot. The two files in examples/fixtures/ are sine tones generated for the tests.
Used by
Zee's Games
Zee's Games is a collection of games I made on GameSpice, for demonstration and for fun. They show what the platform can do, and they run on live servers you can join. Anybody can create games on GameSpice, and each addon is its own repository and can be used separately from the games and from the rest of GameSpice.
No shipped game uses it yet; the example scenes (radio_selftest and its siblings) show it.
The whole collection is at zeesgames.com.
Status and licence
A GameSpice addon under the MIT licence, built with Claude Code. The headless scenes radio_selftest, radio_net_selftest and radio_cover_selftest cover it. Zee's Games are built on the GameSpice addons and run on live servers, though none of them ships this one yet. Report bugs on the issue tracker.
MIT licence, see LICENSE. The only closed part of the GameSpice platform is the web back end; you can use your own instead of GameSpice's.
Активность со временем
GS - Radio, ассет для Godot. У него 3 скачивания, 51 просмотр и 0 добавлений в избранное. Этот объект входит в: 5 тегов.
Отзывы
Войдите, чтобы оставить отзыв.
Комментарии (0)
Войдите, чтобы комментировать.
