This might help. The only problem is that you can keep hitting the "play" button even if the previous click hasn't stopped playing. Should be a problem if the wav is a short file.
Code:
Break On
Break On
$System = CreateObject("Kixtart.System")
SetConsole("HIDE")
;KD START
;************* Form **************
$Form = $System.Form()
$Form.BackColor = 150,192,200
$Form.FontName = "Tahoma"
$Form.FontSize = 8
$Form.Height = 291
$Form.Left = 20
$Form.Text = "KiXforms Designer Template"
$Form.Top = 20
;**************************************
;************* Button1 **************
$Button1 = $Form.Controls.Button()
$Button1.FontName = "Tahoma"
$Button1.FontSize = 8
$Button1.Height = 23
$Button1.Left = 40
$Button1.Text = "Meas.no 12-14"
$Button1.Top = 60
$Button1.Width = 100
$Button1.OnClick = "fnPlayWav(c:\osusong1.wav)"
;$Button1.OnClick = "PLAY Bess12.wav "
;**************************************
;************* Button2 **************
$Button2 = $Form.Controls.Button()
$Button2.FontName = "Tahoma"
$Button2.FontSize = 8
$Button2.Height = 23
$Button2.Left = 40
$Button2.Text = "Meas.no 27-32"
$Button2.Top = 100
$Button2.Width = 100
$Button2.OnClick = "PLAY Bess27.wav "
;**************************************
;KD END
$Form.Show
While $Form.Visible
$=Execute($Form.DoEvents())
Loop
Exit 1
Function fnPlayWav($sWavFile)
If Not Exist($sWavFile) Exit 2 EndIf
$objShell = CreateObject("WScript.Shell")
Exit $objShell.Run ("Sndrec32.exe /play /close " + $sWavFile , 0, 0)
EndFunction