home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
dos
/
prg
/
dsik205
/
dsik.dat
/
EXAMPLES
/
EXAMP01.C
next >
Wrap
C/C++ Source or Header
|
1995-04-10
|
2KB
|
56 lines
/****************************************************************************
*
* Digital Sound Interface Kit (DSIK)
* Version 2.00
*
* by Carlos Hasan
*
* Filename: example1.c
* Version: Revision 1.0
*
* Language: WATCOM C
* Environment: IBM PC (DOS/4GW)
*
* Description: Play a music module file.
*
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include "audio.h"
#include "import.h"
#define MODPATH "SONG.DSM"
#define MODFORM FORM_DSM
int main(void)
{
SoundCard SC;
DSM *M;
dRegisterDrivers();
if (dLoadSetup(&SC,"SETUP.CFG")) {
printf("Please run SETUP.EXE to configure.\n");
exit(EXIT_FAILURE);
}
if (dInit(&SC)) {
printf("Error initializing the sound system.\n");
exit(EXIT_FAILURE);
}
atexit((void(*)(void))dDone);
/* you can use directly dLoadModule to load DSM module files */
if (!(M = dImportModule(MODPATH,MODFORM))) {
printf("Error (%03d) loading %s module file: %s.\n",
dError, MODPATH, dErrorMsg[dError]);
exit(EXIT_FAILURE);
}
dSetupVoices(M->Header.NumTracks,M->Header.MasterVolume);
dPlayMusic(M);
printf("Playing module. Press any key to continue.\n");
while (!kbhit()) dPoll();
dStopMusic();
dFreeModule(M);
return 0;
}