Announcement

Collapse
No announcement yet.

Why won't WAV play?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why won't WAV play?

    I saw something like this posted and incorporated it into some code as shown. Why won't the wave play?

    sound.rc contains only these lines:

    welcome wave pc_hall.wav
    bye wave pc_hall.wav

    sound.rc was compiled with rc and pbres succesfully

    the code:

    #COMPILE EXE
    #INCLUDE "WIN32API.INC"
    #INCLUDE "COMDLG32.INC"
    'this resource contains the wav files
    $RESOURCE "sound.pbr"

    FUNCTION PBMAIN ()

    LOCAL lpWav AS BYTE PTR

    hInst&=GetModuleHandle("")
    hRes&=FindResource(hInst&,"welcome","wave")

    IF hRes& THEN
    lpWav = LockResource (LoadResource (hInst&, hRes&))
    IF lpWav THEN FUNCTION = PlaySound(BYVAL lpWav, hInst&, %SND_MEMORY OR %SND_ASYNC)
    END IF

    DIALOG NEW 0,"Sound Demo",,,200,100,0,0 TO hDlg&

    DIALOG SHOW MODAL hDlg&

    END FUNCTION
Working...
X