Music stopping endpoint (or even button)

Is there any unofficial or maybe official endpoint in the API which will turn off all the music-type assets?

When I run games, I use mostly Spotify playlists, but using sounds would still be nice. Turning off music every time I change the mood takes time during the session. One button or switch at the top of the GM control would be of help. But having endpoint is good enough - I can create a bookmark for that.

You could duplicate the soundset, and change the moods to turn off the music - I do not know if there’s a more technical answer, but that is the first thing that comes to mind.

That is not currently possible, but a good feature suggestion!

1 Like

Or maybe it is possible to pull currently playing assets from the API, check their type and then simply turn off all music. That would be a good workaround for the time being :slight_smile:

That won’t work, when I am in a heat of a session :slight_smile: I want to spend as little time on running the mood as possible. Actually, what you suggested is what I did in the past, but that became an issue when I try to run two moods from different sets and need to switch between them.

btw. another feature request (only on the FE side I think): recently visited sounds sets, so I can quickly jump between them if needed.

I can give you tons of ideas, but actually, since you provide an API + web UI, I can think of creating “plugins” for the browser to add some stuff separately. You know… community driven :slight_smile:

1 Like

Hi there I’m not very technically minded but can you not just copy the remote control for STOP and paste somewhere, edit what it’s called and then just click that to stop all sounds at the same time?

Depends how you are running sessions I suppose. Online, in person, on a network?

I may have misinterpreted what you mean also so please understand that too.

It’s not about stopping sounds, but the music type only. I didn’t have time to check data returned by the endpoints, because perhaps it’s easy to get all playing sounds and check their type, then simply stop only the music ones. As I noted above.
I am asking only about some unoficcial endpoints, because apart from that I am an experienced Django developer myself and work with DRF on a daily basis, so it’s easy to use for me :wink:

Ah right ok. No worries.

Django was just a film to me until about a week ago. :joy:

1 Like

Note: you can bring up the currently playing elements in the SEARCH tab and stop them for there…

…but indeed… I reckon you shooould be able to develop something using the API that will identify currently playing elements that ARE music and stop those. That sounds like a fun project! :slight_smile: :robot: :hammer:

1 Like

Another idea is to provide a separate volume level bar for music only :wink: I could turn it down to 0 + control it separately.

In case anyone else finds this useful, this turned out to be a lot simpler than I thought it would be. Here’s some example python.

#!/usr/bin/env python3

import json
import requests

AUTH_TOKEN = ''  # TODO

SEARCH_URL = 'https://syrinscape.com/search/?f=json&q=&kind=Music&playing=Now%20Playing&auth_token=' + AUTH_TOKEN

def main():
  with requests.Session() as session:
    r = session.get(SEARCH_URL)
    search_response = json.loads(r.content)
    music_ids = []

    for r in search_response['results']:
      music_ids.append(int(r['meta']['id'].lstrip('Element:')))
    print(music_ids)

    for id in music_ids:
      r = session.get('https://www.syrinscape.com/online/frontend-api/elements/%d/stop/?auth_token=%s' % (id, AUTH_TOKEN))
      print(r.content)


if __name__ == "__main__":
  main()

~

1 Like