fmSoundPlayer Sound Effects on the Fly with FileMaker

At Cimbura.com, we do a daily stand-up SCRUM meeting with our developers. Since having fun while we do brilliant work is one of our company values, we thought it would lighten up the meeting if we added some interesting sound effects to help keep us on track.

For example, a gong sound gathers us all together. If someone has used up too much time or needs to take a topic offline we sound the end of game buzzer. When we launch a new WordPress website or put a custom FileMaker app into production there’s applause! A new person added to the group gets a doorbell sound. If there’s an emergency you here the siren warning sound.

We thought this might be a great opportunity to create a quick FileMaker app to help us out. It’s a simple database of sounds, titles, and two container fields to hold an image and an mp3 or wav sound file. Along the way we learned that playing a sound on command is a little trickier than expected. First, there is no simple “Play Sound” script command in FileMaker. There are script commands to play movies…but that’s not the same thing.

fmSoundPlayer Sound Effects on the Fly with FileMaker 2

After several attempts to make this work we finally arrived at the following solution.

First, you need a global container field in the table to be used as a utility to play the sound on script command. We called it gSoundPlayer. On the layout in the Inspector you must select this field and optimize for “Interactive content” and then check “Start playback automatically”. Normally, you do not want this set since as soon as you enter a record it would play the sound….annoying.

We also found it helpful to hide the field by entering a “1” in the “Hide object when” Inspector field Behavior area. Then drag the gSoundPlayer field into the header or footer of the layout so there is only one instance of it on a list view. This is critical to avoid multiple instances of the field on one layout that creates an issue where they try to all play simultaneously and ruin the sound quality.

fmSoundPlayer Sound Effects on the Fly with FileMaker 5

The script to Play the sound moves the sound from the Sound container field to the global gSoundPlayer field. Upon doing so it will automatically play. Then the script waits for a few seconds for the duration of the sound if it can be calculated or 5 seconds if unknown or >= 10 seconds (wav files). It then clears the field stopping the sound play.

fmSoundPlayer Sound Effects on the Fly with FileMaker

If you want to cut off or stop the sound early, the stop button does the following.

fmSoundPlayer Sound Effects on the Fly with FileMaker 1

Pretty straight forward once you know the trick. Have fun with this free sample file here. fmSoundPlayer

You can use it to create your own sound collection and play them on demand.

fmSoundPlayer Sound Effects on the Fly with FileMaker 4

If you wanted a modern hotel desk bell, maximize that sound and leave it open on an iPad.

fmSoundPlayer Sound Effects on the Fly with FileMaker 3

When looking at the sample file, there is an easter egg when you play the gong or siren sounds. Enjoy!

(Note: The special effects are not visible on FileMaker Go since they are not applicable on iOS.)


Also published on Medium.

About Us 11

Tim Cimbura – CEO and Solution Engineer

Tim is an expert in creating custom business solutions that make your work more effective, productive, and profitable. He specializes in FileMaker application development (certified in versions 8-15) for Mac OS, Windows, iPad/iPhone as well as integration with the web using WordPress, PHP, and AppleScript. He knows Apple technology and Windows systems inside and out.

Comments

  1. Dominick Capobianco says:

    Saw your database and it “sounded” like a good idea to download it and it was. Love it.

Speak Your Mind

*