home *** CD-ROM | disk | FTP | other *** search
- #include <dos.h>
- #include <sbc.h>
- #include <bios.h>
- #include <sbcvoice.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include <io.h>
-
-
- //┌───────────────────────────────────────────────────────────────────────┐//
- //│ MASTER LOOP │//
- //└───────────────────────────────────────────────────────────────────────┘//
- sb_disk_play (char *filename)
- {
- ct_io_addx = 0x220 ;
- if (sbc_check_card() & 4)
- {
- if (sbc_scan_int())
- {
- if ( !ctvd_init(16) )
- {
- play_file (filename);
- ctvd_terminate () ;
- }
- else show_error (7, "Soundblaster Problem")
- }
- else show_error (8, "Interrupt Error");
- }
- else show_error (9, "Soundblaster not found");
- return;
- }
-
-
- //┌───────────────────────────────────────────────────────────────────────┐//
- //│ MASTER LOOP │//
- //└───────────────────────────────────────────────────────────────────────┘//
- play_file (char *filename)
- {
- int handle ;
- handle = open(filename, O_RDONLY);
- ctvd_speaker (1);
- if (ctvd_output(handle) == NO_ERROR)
- {
- play_voice_in_bkgnd();
- if (ctvd_drv_error()) show_error (7, "Soundblaster Problem")
- }
- close (handle);
- return;
- }
-
-
-
- //┌───────────────────────────────────────────────────────────────────────┐//
- //│ MASTER LOOP │//
- //└───────────────────────────────────────────────────────────────────────┘//
- play_voice_in_bkgnd ()
- {
- nsigned key ;
-
- /* Polls for hot key while playing voice file */
-
- while ( ct_voice_status )
- {
- kbhit();
- }
- return;
- }
-
-