Hello Guest it is April 23, 2024, 03:31:19 PM

Author Topic: Sound in Mach4  (Read 421 times)

0 Members and 1 Guest are viewing this topic.

Sound in Mach4
« on: September 25, 2022, 03:42:55 PM »
Can anyone point me in the right direction for adding sound (wav files) to Mach4, such as when a probe touches, or a limit is hit? I've seen DaztheGas's Quicky #1 video and have followed his example... the button works after adding the code and restarting mach, but then stops working after the next restart. If anyone has sound working in M4 could you share some code on how you have it set up? Had no problems adding sound to M3, but lua is kicking this old man's butt (beginning to believe the "You can't teach an old dog new tricks" thing).

Andy
Hit the e-stop! Hit the e-stop!
Re: Sound in Mach4
« Reply #1 on: September 26, 2022, 03:15:26 PM »
Try this...just replace the path with the path to your sound

Code: [Select]
local sound = wx.wxSound("C:\\Windows\\Media\\chimes.wav", false)
sound:Play(wx.wxSOUND_ASYNC)