Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Possible to make API that streams in music?

With roll20's fanburst woes, I wondered if it would be possible to write an API that plays music from other sources. Is that something that's within the power of an API? Or is that something that just can't be done? I imagine the current roll20 music stuff is already an API. What I was imagining was inputting a command that plays a song that it gets off some location, perhaps your own FTP.
1549571858
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm not an API programmer, but I would be extremely surprised if the API sandbox could grab any outside data source like that.
1549573919
The Aaron
Roll20 Production Team
API Scripter
Kieth is correct, this is outside the scope of the API. 
1549573987
The Aaron
Roll20 Production Team
API Scripter
Probably if you wanted to do this, you’d need some sort of hardware or software mixer that would take the place of your mic for your audio input. 
1549574876

Edited 1549575029
If you use Discord for voice, check out rythmbot.co or other music streaming bots. edit: I should probably mention that this is not what you're asking for, but is an alternative.
you can read the instructions that Syrinscape provides at  pro-tips-how-to-use-syrinscape-well . Even if you don't use Syrinscape, this will explain to you what a virtual audio device is and how to use it on every platform and with every major voice chat system.
Sooo... it IS in fact now possible to control Syrinscape with API links. I recommend checking out THIS page:&nbsp; <a href="http://www.syrinscape.com/online/" rel="nofollow">www.syrinscape.com/online/</a> This is our thing we (at Syrinscape) built for people using VTTs such as Roll20. I won't go on about it here, since you can find out everything you need to know on the page, BUT the relevant bit for this thread is, we now have API links working on the Online Player, meaning you can control your Syrinscape sounds from within Roll20 using weblinks (these weblinks ping our server, and act as button pushes on Syrinscape = changing the background mood, or starting some music, or triggering a Wilhelm Scream, or a Fireball, or a Wilhelm Scream caused by a Fireball). As Ammo mentioned above, the Syrinscape forums are a great place to find out how all this works etc. Or ask questions here, too. :-)
1550446270
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
As I understand it, this puts a url into chat, which when clicked on sends a command to the Syrinscape API?
Syrinscape Online, actually allows Players (who don't actually need subs or anything) to FOLLOW the game of a single Game Master. The Game Master's clicks get automatically broadcast out to all the 'following' players, who's little Syrinscape Online Box players all the sounds on their actual local machines (rather than having to squeeze the music down a chat client or anything). The API bit is for the Game Master to NOT to have to leave Roll20. Anything that allows link clicks out to external art or info online can be used to trigger a Syrinscape click in the Game Master's Syrinscape account (and THAT click is then broadcast out to his/her Players). Does that make sense? Ask more questions, I think I'm assuming too much knowledge and missing obvious bits! :-D
1550460947

Edited 1550460984
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It sounds like you are restating what I said. A game master clicks a link in Roll20 (in chat or perhaps a handout), and this sends a "click" to the Syrinscape API, and all players using your online app who are part of that game will hear the indicated audio. Correct? Further, this requires no expenditure upon the part of the players? The GM does not need to sub either, unless they want access to more than your introductory-level audio? Feel free to correct any misunderstandings.
This sounds... amazing, actually. Wait, so, would this link be visible to all the other players? That would be my only hangup, since it would be a little distracting if there's links being spit out into chat for everyone every time you play a song. But that's still a huge step forward!
Keithcurtis: "A game master clicks a link in Roll20 (in chat or perhaps a handout), and this sends a "click" to the Syrinscape API, and all players using your online app who are part of that game will hear the indicated audio" Yup. So the Game Master might prepare a series of required sounds earlier. He/she might embed these API Links into game notes, or a comment on monster stats or whatever and when that is click it will trigger Syrinscape to play the appropriate sounds on everybody's Online Player (whereever they are running in the world. The Game Master is the only person who needs a subscription (SuperSyrin) to make this run. We are considering making this game running feature available to all sub levels (including the cheapest = Server access), but that is a debate currently... :-D The players only need a (free) account. Keep asking questions, these are good ones. :-)
"would this link be visible to all the other players?" No, the Players would NOT see this link. DEPENDING on the level of integration that the Roll20 team are able to offer, the link will either: 1) Open a new browser window on the GM's machine (which they will have to simply close with an additional click) 2) Silently send the call in the background = ie Roll20 recognises the API call as something that doesn't need to be shown to the GM and silently calls it in the background. 3) Actually, we've even done enough work on OUR end, to make the Syrinscape interface items, (eg Moods and Elements available to the Game Master) visible within partner apps. That is: Roll20 might actually display something like a Syrinscape interface, WITHIN Roll20, giving fans of these two cool things access to the sounds they own in Syrinscape within Roll20 with almost no friction at all. Cool, huh! :-)
Awesome! Hmm, would it be possible to make it work like other API text chat commands, where you send the command in the text chat, and it sends the command to Syrinscape to play? Then, I presume you'd have your songs in Syrinscape, so you'd do something like "!play &lt;song&gt;" and maybe that would play the song or sound you want.
mAc said: would it be possible to make it work like other API text chat commands, That question goes beyond my specific Roll20 knowledge, BUT I know there are some BIG Roll20 users/fans who have been discussing this sort of stuff on our forums recently, and will presumably be sharing the results of their experiments around here soon. So... stay tuned?
1550468568
Kirsty
Pro
Sheet Author
I'm intrigued. I'll definitely be looking at your service over the next couple of days. :)
1550472766
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You have brought up Roll20 integration. Have you contacted Roll20 directly? If not, that seems like the next logical step.
mAc said: Awesome! Hmm, would it be possible to make it work like other API text chat commands, where you send the command in the text chat, and it sends the command to Syrinscape to play? Then, I presume you'd have your songs in Syrinscape, so you'd do something like "!play &lt;song&gt;" and maybe that would play the song or sound you want. TL;DR: No. &nbsp; Roll20 will not follow a link to an external site silently. &nbsp; You can display a text that is an anchor for a GET link and the user must click on it (the GM in this case if the players are linked to the GM's Syrinscape thingy). &nbsp; Then Roll20 will display a warning dialog that tells you this link is external and are you sure you want to follow it? &nbsp;Then you confirm that and there you go you made a GET request outside the sandbox. &nbsp; I used this to build integration with an external web site by putting a bunch of info in query strings on a GET request, because POST isn't allowed. &nbsp;But it isn't convenient at all because of the confirmation dialog, which is obviously required for security reasons. Real integration that doesn't suck :) would require some support from Roll20 to allow the URLs required by Syrinscape. &nbsp;This is a huge can of worms with security implications. &nbsp; Instead, I recommend implementing the required glue in <a href="https://ssstormy.github.io/roll20-enhancement-suite/" rel="nofollow">https://ssstormy.github.io/roll20-enhancement-suite/</a> &nbsp; and not doing ANYTHING on the Roll20 side. &nbsp; Just embed the UI you need into the Roll20 UI on the GM's client side, and there you can open whatever URL you want. &nbsp; Syrinscape (or a motivated third party) could write this without any help from Roll20.