In 16-bit Windows 3.x and WFW, you used the sndPlaySound function in mmsystem.dll. In 32-bit Windows 95/98/ME/NT/2000, you use the PlaySound function in WINMM.DLL.
Click here to download a 32-bit Paradox example of how to play a wave file. Comes complete with FULL documentation.
Here is the pertinent code:
;Here is the uses prototype for the PlaySound function. ; Uses WINMM PlaySound(WavFile CPTR, handle CWORD, Flag CWORD) endUses ; ;Now just use it, for example in a pushButton event: ; method pushButton(var eventInfo Event) playSound("mywave.wav", 0, 0) endMethod
Here is a bit more complete example that plays a file in the working directory. I have verified this works with Paradox 11 on Vista too.
;Here is the uses prototype for the PlaySound function. ; Uses WINMM PlaySound(WavFile CPTR, handle CWORD, Flag CWORD) CWORD endUses ; ;Now just use it, for example in a pushButton event: ; method pushButton(var eventInfo Event) var sSoundFile String siReturnValue SmallInt liMode LongInt endVar
const SND_SYNC = 0 ;See documentation for various modes. You might want to ;define all of the flag constants in a library. endConst
;Evaluate result. if siReturnValue = 0 then ; Trap error here. msgInfo("Warning", "Sound file did not play.") else ; Sound file did play. endIf endMethod