Playing Sound in MapTool via Syrinscape

Playing Sound in MapTool via Syrinscape

One of the overlooked features of MapTool 1.5 is the introduction of RESTful functionality in the MapTool scripting language – MTScript. For the non-programmers, RESTful is a software architectural style that defines a set of constraints to be used for creating Web services. These take the form of an HTTP call, like when you put a web site URL into your web browser. The industry term for exposing a RESTful interface is called an Application Programming Interface or API.

But enough of the Geek Speak.

To the rest of us, pun intended, a RESTful service is just a call to a web endpoint who’s purpose is to return data, not web pages. You can test out the GitHub API for our RPTools repository by placing the following into your web browser.

https://api.github.com/users/RPTools/repos

The call returns a large JSON array detailing the contents of the RPTools repository. Simple, right?

The gist of all this is that MapTool, via macros, can communicate with other online systems. You can leverage this to bring sounds into your campaign via Syrinscape as demonstrated in the video below.

MapTool is able to utilize Syrinscape’s REST API via a macro. You simply copy the URL and auth token by clicking Show Remote Control Links from the Syrinscape Master interface. Once you have the URL, you construct a macro call to Syrinscape with something like the following:

[r: REST.get('https://www.syrinscape.com/online/frontend-api/moods/19/play/?auth_token=<insert your auth token here>')]

Once run, the macro will start playing to all the connected players.

Of course, with MapTool’s powerful scripting engine, you can do a whole lot more, like fire off one-shots when a players Initiative comes around or that awesome Heal Light Wounds (from Kyra’s sound set) every time your Channel Healing macro is used. You could also bake in some tokens on a map for quick links to selected moods for easy access.

The Path Forward

The RPTools contributors are currently in the process of adding audio streaming into MapTool. This will start with the macro calls to local or remote files and end with a GUI interface and preferences. It was made quite clear by some of our users they don’t want sound due to limited bandwidth and other considerations so you will always have the ability to keep MapTool mute. You can look for the first version of the new streaming ability in version 1.5.5.

Excited about the new functionality? Let’s discuss in the comments below or on one of our many social outlets.

Live chat on Discord
Join in the conversation on the RPTools Forum
Like us on Facebook
Follow us on Twitter
Reddit
Log and issue or fork a branch of the code on GitHub

MapTool Latest Release 1.7.0

You can download the new version of MapTool from the following links.

A JAR file version may be downloaded from the MapTool GitHub Repo and is only recommended for developers or other advanced users.

If you need help, please join our Discord Server. A list of all changes can be found in our Change Log

4 Responses to Playing Sound in MapTool via Syrinscape

  1. I think this is a great new feature. I’ve experimented with using ambient sounds in my games and they have had a big effect on the players. I could tell they really liked it.

    Integrating sound capability into MapTool was a very smart move. Other tools like microphones, Discord, etc. have built-in noise filtering features that defeat tools like Syrinscape. I’ve tried it. I turned off all the filtering on my end — buy my players still had it turned on (and might need it!).

    So, having MapTool convey the ambient and other sounds is a great move! Thank you for doing this! I’m investigating the capability and plan to use it soon.

    My plans to use it do not involve Syrinscape’s streaming service. I don’t want to pay for a service. Instead, I bought their sound packages outright and will figure out how to use that.

    Ideally, I’d like to stream sound files from my local computer — as well as play various sound effects for spells, etc. I’ve noticed that the API supports both.

    Sound adds a much needed dimension to our games. I will be integrating it into my games within this next month. Just a little busy right now making major UI changes to use frames and dialogs — and stop using input().

  2. I have tried multiple times to make the playClip and playStream functions work from both online and locally stored files but it has not worked yet.
    Could you create a link with a working example?

  3. The best advice I can give is to go over to Discord (link in sidebar) and request help from folks like Jamz and others that have integrated it into their campaigns.

Leave a reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.