Dumb API question- volumes?

Hi All,

Stupid question. I’ve just started using the REST API to trigger Syrinscape sounds using my Elegato Streamdeck.

I like to make moods without music for ambient sound. Then I trigger a music element over the top, so it can go from tension to battle to whatever.

I’ve got buttons set up for the moods, no problem. (The new beta search is awesome for getting those constructed quickly and customising them).

I just trigger something like:
https://syrinscape.com/online/frontend-api/moods/284437/play/?soundset__uuid=blah

Then I can add the music with something like:
https://syrinscape.com/online/frontend-api/elements/1541818/play/

I pulled those URL’s from the Chrome Network Inspector whilst running the master control panel.

BUT… the music often seems to come in at full volume, which is deafening.

I’ve adjusted the “initial volume” of the music element in the soundset but that doesn’t seem to work reliably. Sometimes it shoots back up to 100% when I trigger it and I can’t work out whether it is meant to or whether I am doing something wrong.

So two questions:

  1. What I am doing wrong?
  2. How do I trigger an element and force it to be at a certain volume level? Or once playing, how do I change its volume? The URL for changing volume when I tweak it in the Master Interface is:
    https://syrinscape.com/online/frontend-api/elements/1541818/set_current_volume/

which doesn’t contain the desired volume level.

Sorry, totally new to using web APIs so please explain to me as if to a total idiot, because total idiot.

Cheers, Hywel

I thought I had it, I thought if I triggered the elements with the soundset uuid postpended, it would play the “version” of that sound from the soundset and so pick up the appropriate volume settings.

But nope, back up to 100% volume again.

Help!

Cheers, Hywel

So to change the volume you have to PUT the following JSON snippet to that address:
{'current_volume' : 0.5}
(assuming a volume level of 50%).

You can check the initial volume of an element for each mood in a given soundset by looking at the volume field, e.g. on this page (you will need to append your token): https://www.syrinscape.com/online/frontend-api/moods/?soundset__uuid=30e64e78-a7e1-11e2-ab8f-68a86d087c62 (you will also need the UUID of the soundset!)

You can also see it for a given mood (might be easier?): https://syrinscape.com/online/frontend-api/moods/19/

If those volumes are set to 1.0 then they are set to play at full volume in the soundset itself. I have certainly found that volumes that I thought I’d saved had reverted because I’ve assumed that the initial volume of the element in the mood had been set, when actually it was just the current volume of the element I’d changed. It’s a bit confusing, isn’t it!? It’s certainly worth checking that the Target Volume in the Mood Element section of the Property Inspector is set to your correct level; if you find that this is set to 100%, that’s probably the culprit.

Pob lwc!

2 Likes

Diolch yn fawr iawn!

I feel like I am missing (at least) one critical ingredient of understanding - how to send an HTTP PUT request (and consequently how to append the JSON which specifies the volume).

I’m using an Elegato Stream Deck to trigger the sounds, using the “website” button from the various different streamdeck possible button settings. That lets me supply a URL, which it then forwards to my default web browser which pops up a window. I assume that is telling the web browser to send an HTTP get request?

I’m guessing I instead need to be able to trigger some code snippet in which I assemble an arbitrary HTTP request to send, is that right? I can’t just type some different text string into the website button on the Streamdeck and get it to magically send an HTTP PUT request with the JSON?

Sorry I know it is an extremely dumb problem to have! Can someone who has set up the Streamdeck to do stuff like this throw me a line?

Cheers, Hywel

Dim Problem! Us Welsh Scientists have to stick together (well, OK, it’s been 20 years working in unrelated fields since my physics masters, but still :slight_smile: )

Yes, that sounds right. Which means you might be out of luck using that particular method for a PUT request, sorry :frowning:

So I don’t think it’s a dumb problem at all! More like a limitation of using the Elgato, perhaps?

It looks like there’s an SDK for the Elgato which will let you run your own plug-ins using the programming language of choice; sending HTTP requests should be a relatively straightforward thing to do in those languages.

But first: are you absolutely sure that you need to do this, and it’s not that the initial sounds haven’t been set and saved in the online interface? It’s absolutely worth checking first!

-Tomos

1 Like

OR: I’ve just found this guy’s github, which includes Stream Deck plug-ins for making HTTP requests: https://github.com/sbelectronics/streamdeck

1 Like