Page 1 of 1

Sound is not playing

Posted: 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

Posted: 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

#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

Posted: 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

Posted: 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.

Posted: 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

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

Sounds not playing

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

Posted: 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

#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.

Posted: 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.