Page 1 of 1

Sound is not playing

PostPosted: Tue Aug 07, 2007 6:27 pm
by xhbcoder
Hi all,

What may be the cause of function sndPlaySound to fail. The speaker is functioning correctly.

Environment: windows xp, clip52 fw24

Thanks,

Jose

PostPosted: Thu Aug 09, 2007 10:45 am
by Antonio Linares
Jose,

Try it this way. Here its working fine with Clipper and Vista:
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   SndPlaySound( "test.wav", 0 )

return nil

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL PASCAL LIB "MMSYSTEM.DLL"

Sound still not playing in Windows XP

PostPosted: Thu Aug 09, 2007 4:44 pm
by xhbcoder
Antonio,

I follow your sugesttion but, the sound is still not playing. The function sndPlaySound return false.

Thanks,

Jose

PostPosted: Thu Aug 09, 2007 7:06 pm
by Antonio Linares
Jose,

is you wav file ok ? Can you play it with windows media player ?

The sounds good.

PostPosted: Thu Aug 09, 2007 8:29 pm
by xhbcoder
Antonio,

Thanks for the quick reply. The file sounds good with windows media player.

Regards,

Jose

PostPosted: Thu Aug 09, 2007 8:45 pm
by Antonio Linares
whats the name (including its path) of the wav file ?

Sounds not playing

PostPosted: Thu Aug 09, 2007 9:06 pm
by xhbcoder
Horn.wav, startup.wav. I can send you the file if you need.

PostPosted: Thu Aug 09, 2007 11:58 pm
by Antonio Linares
Jose,

Got your files and this code is working fine with Clipper, FW 7.07 and Vista 32:
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   SndPlaySound( "startup.wav", 0 )

return nil

DLL FUNCTION SndPlaySound( cFile AS LPSTR, nType AS WORD ) AS BOOL PASCAL LIB "MMSYSTEM.DLL"

I'm ever gotten that promble like you.

PostPosted: Wed Aug 22, 2007 3:53 am
by Peter
I'm ever gotten that promble like you. But if the WAV file not long time it work. I think the WAV file not over 2 Minute be work fine.