I’ve recently begun work on a project to stream audio from Syrinscape online via a Discord bot using Discord.js.
I’ve made some progress so far, and the github repo can be found here for anyone interested: https://github.com/jmccuen/SyrinscapeDiscordBot (MIT License)
Right now, it will connect to the websocket endpoint, register the device and link it to the game. The websocket stream then received JSON messages with the .ogg files.
Once you connect to the websocket endpoint, you can register your device by sending the following two messages:
“device_uuid”: “” //add the auth UUID from your player here
and you will begin to see json response messages with mood elements such as:
“name”:“Environmental systems hum”,
From here, we can parse the .ogg files and stream them in to the Discord voice channel – but this seems a little odd to me, I would’ve expected the audio to just stream over the WebSocket channel (and be mixed on the server), so I thought I would post here first to see if anyone could confirm this is the case.
Let me know if anyone has any thoughts and feel free to submit a pull request directly to the repo.
Edit: You can get it to play a single element pretty easily by just passing the .ogg file url into the Discord dispatcher’s play method when the message comes in, by the way – there just seems to be a lot of complicated logic around mixing the files.