My Friend View This Source
For Run Sound Wave From Resource And Wave File
Bat Not Compiler With Function hb_parc(1)
Thank For All
// Test Sound Source
#include "FWCE.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "TEST sound "
@1,10 button "Test 1 PLAYWAV()" size 150, 20 action PLAYWAV()
@4,10 button "Test 2 PLAYWAVRES()" size 150, 20 action PLAYWAVRES()
ACTIVATE WINDOW oWnd
return nil
********************************************************
#pragma BEGINDUMP
#include <hbapi.h>
#include <Windows.h>
#include <mmsystem.h>
HMODULE GetResources( void );
extern HINSTANCE GetInstance( void );
void HB_FUN_PLAYWAV()
{
// char cfile * =hb_parc(1);
PlaySound(_T("\\Windows\\Default.wav"), NULL, SND_ASYNC | SND_FILENAME);
// PlaySound( cfile, NULL, SND_ASYNC | SND_FILENAME);
}
void HB_FUN_PLAYWAVRES()
{
// char cfile * =hb_parc(1);
PlaySound (_T("testSound"), GetResources() ? GetResources(): GetInstance(), SND_RESOURCE | SND_ASYNC);
/// PlaySound ( cfile, GetResources() ? GetResources(): GetInstance(), SND_RESOURCE | SND_ASYNC);
// MessageBox( GetActiveWindow(),cfile , _T("VIEW THIS"), 0 );
}
/*
void HB_FUN_PLAYWAVMEM()
{
BYTE buffer[100*1024];
CFile file;
file.Open(_T("\\Windows\\empty.wav"), CFile::modeRead);
file.Read(buffer, 100*1024);
file.Close();
PlaySound((const unsigned short *)buffer, NULL, SND_MEMORY | SND_ASYNC);
}
*/
#pragma ENDDUMP
/*
// FILE TEST_SO.RC //
// SAVE THIS TEXT FOR FILE ( TEST_SO.RC )
// BUT ANY FILE SOUND (SMAIL ONLY) TEST.WAV
// AND Compiler FILE TEST_SO.PRG
testSound WAVE "test.wav"
*/