Demo: Pocket-G Music Mix Library

Postby Admin on Sun Apr 14, 2002 4:57 am

<b>Introduction</b>
Pocket-G Music Library is a multi-channel run-time wave mixing engine, in the form of the Dynamic Linking Library (DLL). It provides APIs suitable for dynamic sound generation. With this library, you can easly produce your desired high quality game products.

<b>Purpose</b>
To demonstrate the PocketC native library design, I spend a couple hours to wrap up the library into a PocketC library. Full source code can be http://www.orbworks.com/wince/pgsound/PGSound.zip.

<b>Documentation and License</b>
Original PocketG Music Library API Documentation and License Information:
Please visit: http://www.pocket-g.com/Products/pgsnd/

<b>PocketC Wrapper API List:</b>
#export pgsound(0) pg_waveinit(int hwndMain, int nPlayBackRate, int nMixChunkSize, int nMaxChannel) ;
#export pgsound(1) pg_waveclose() ;
#export pgsound(2) pg_waveactivate(int bActivate) ;
#export pgsound(3) pg_waveplay(int nChannel, int bLoop) ;
#export pgsound(4) pg_wavestop(int nChannel) ;
#export pgsound(5) pg_wavesetvolume(int nVal) ;
#export pgsound(6) pg_setchannelvolume(int nChannel, int nVolL, int nVolR) ;
#export pgsound(7) pg_loadwavefile(string filepath, int nChannel) ;

<b>Sample Program:</b>
/* Wave Files used in this sample is included with the pgsound.zip download */
test_channel()
{
pg_loadwavefile("sounds\\ch1.wav",0);
pg_loadwavefile("sounds\\ch2.wav",1);
pg_loadwavefile("sounds\\ch3.wav",2);

pg_wavesetvolume(64);
pg_waveplay(0,1);
pg_waveplay(1,1);
pg_waveplay(2,1);
sleep(4000);
}

main()
{
int mainwnd ;
mainwnd = gethwnd(0);
pg_waveinit(mainwnd,4,44100,8192);
test_channel();
pg_waveclose();
}

<b>Questions</b>
Please send to [url]cao@orbworks.com[/url]
Admin
 
Posts: 86
Joined: Fri Oct 06, 2000 6:00 am
Location: USA

Return to PocketC for CE KB

Who is online

Users browsing this forum: No registered users and 1 guest

cron