PDA

View Full Version : play a sound?



jkeller
November 28th, 2025, 03:04
Is there a way for an extension to play a sound?

AI said this, but I think it's hallucinating:

Fantasy Grounds Unity LUA provides a direct function for extensions to play sounds and music within the client (both Host and connected Players).
The function you need is part of the standard Sound manager.
The LUA Function: Sound.playFX()

If it matters, I'm using the 5E ruleset.

Thanks!

Zacchaeus
November 28th, 2025, 09:48
I suspect that if it were possible for an extension to play sounds then several of them would be available now. But I'm not a coder so I don't know that for sure. The only built in sounds are the beeps on start of turn and the dice rolling sounds; so it is possible to play sounds directly.

All of the extensions which have existed or currently exist use the OOB system to trigger sounds played via some third party software and piped into the clients via a VOIP program. This is pretty much the same way that all of the other VTTs play sounds as well, only they use your browsers built in sound, or another third party system. This is also how FGVTT plays sounds via the Syrinscape web player.

LordEntrails
November 28th, 2025, 16:37
I found no sound related APIs in the Developer Guide; Developer Guide - API Reference - Fantasy Grounds Customer Portal - Fantasy Grounds (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644535/Developer+Guide+-+API+Reference)
There are some calls to local files that could be used to execute a sound, maybe. I know they have put security around executing local files so that may no longer be possible.

There is a good write-up about sound links, but that is all about using the existing sound triggers; Using Sound Links - Fantasy Grounds Customer Portal - Fantasy Grounds (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/2078932993/Using+Sound+Links)