This will allow you to play sound files on any FactoryPMI client. The approach only downloads the audio when it needs to be played and does not rely on any shared network or local media to store the files - it uses the SQL database.
This script reads the audio file (stored in a BLOB format) from the database, writes it to the local cache, then uses the windows sound recorder to play it. it’s a modification of the fpmi.system.execute() example from the help file. It seems to work surprisingly smoothly.
query = "SELECT wav FROM soundTable WHERE id=1" sound = fpmi.db.runScalarQuery(query) filename = "temp.wav" fpmi.file.writeFile(filename, sound) if fpmi.file.fileExists(filename): fpmi.system.execute(["sndrec32", "/play", "/close", "/embedding", filename])