forked from Tronix286/AIL2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVOCPLAY.C
132 lines (113 loc) · 5.29 KB
/
VOCPLAY.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛ ÛÛ
//ÛÛ VOCPLAY.C ÛÛ
//ÛÛ ÛÛ
//ÛÛ Creative Voice File (.VOC) performance utility ÛÛ
//ÛÛ ÛÛ
//ÛÛ V2.00 of 09-Oct-91 ÛÛ
//ÛÛ V2.01 of 09-Apr-92: .VOC preformatting call added ÛÛ
//ÛÛ ÛÛ
//ÛÛ Project: IBM Audio Interface Library ÛÛ
//ÛÛ Author: John Miles ÛÛ
//ÛÛ ÛÛ
//ÛÛ C source compatible with Turbo C++ v1.0 or later ÛÛ
//ÛÛ ÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛ ÛÛ
//ÛÛ vocplay.obj: vocplay.c gen.h ail.h ÛÛ
//ÛÛ bcc -ml -c -v vocplay.c ÛÛ
//ÛÛ ÛÛ
//ÛÛ vocplay.exe: vocplay.obj gen.lib ail.obj ÛÛ
//ÛÛ tlink @vocplay.lls ÛÛ
//ÛÛ ÛÛ
//ÛÛ Contents of VOCPLAY.LLS: ÛÛ
//ÛÛ /c /v /x + ÛÛ
//ÛÛ \bc\lib\c0l.obj + ÛÛ
//ÛÛ vocplay ail, + ÛÛ
//ÛÛ vocplay.exe, + ÛÛ
//ÛÛ vocplay.map, + ÛÛ
//ÛÛ \bc\lib\cl.lib gen.lib ÛÛ
//ÛÛ ÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
//ÛÛ ÛÛ
//ÛÛ Copyright (C) 1991, 1992 Miles Design, Inc. ÛÛ
//ÛÛ ÛÛ
//ÛÛ Miles Design, Inc. ÛÛ
//ÛÛ 10926 Jollyville #308 ÛÛ
//ÛÛ Austin, TX 78759 ÛÛ
//ÛÛ (512) 345-2642 / FAX (512) 338-9630 / BBS (512) 454-9990 ÛÛ
//ÛÛ ÛÛ
//ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#include <alloc.h>
#include "ail.h" // Audio Interface Library API header file
#include "gen.h" // General DOS and system functions
const char VERSION[] = "2.01";
/*****************************************************************/
void main(int argc, char *argv[])
{
HDRIVER hdriver;
char far *vfile;
char far *drvr;
drvr_desc far *desc;
printf("\nVOCPLAY version %s Copyright (C) 1991, 1992 Miles Design, Inc.\n",VERSION);
printf("-------------------------------------------------------------------------------\n\n");
if (argc != 3)
{
printf("This program plays a Creative Voice File (.VOC) through any Audio Interface\n");
printf("Library digital sound driver.\n\n");
printf("Usage: VOCPLAY filename.voc driver.adv\n");
exit(1);
}
AIL_startup();
drvr = load_driver(argv[2]);
if (drvr == NULL)
{
printf("Couldn't load driver.\n");
AIL_shutdown(NULL);
exit(1);
}
hdriver = AIL_register_driver(drvr);
if (hdriver==-1)
{
printf("Driver %s not compatible with linked API version.\n"
,argv[2]);
AIL_shutdown(NULL);
exit(1);
}
desc = AIL_describe_driver(hdriver);
if (desc->drvr_type != DSP_DRVR)
{
printf("%s is not a digital sound driver.\n",argv[2]);
AIL_shutdown(NULL);
exit(1);
}
if (!AIL_detect_device(hdriver,desc->default_IO,desc->default_IRQ,
desc->default_DMA,desc->default_DRQ))
{
printf("Sound hardware not found.\n");
AIL_shutdown(NULL);
exit(1);
}
AIL_init_driver(hdriver,desc->default_IO,desc->default_IRQ,
desc->default_DMA,desc->default_DRQ);
vfile = read_file(argv[1],NULL);
if (vfile == NULL)
{
printf("Couldn't load %s.\n",argv[1]);
AIL_shutdown(NULL);
exit(1);
}
AIL_format_VOC_file(hdriver,vfile,-1);
AIL_play_VOC_file(hdriver,vfile,-1);
AIL_start_digital_playback(hdriver);
printf("Launching DOS shell. Type 'EXIT' to stop playback and ");
printf("exit VOCPLAY.");
spawnlp(P_WAIT,"command.com",NULL);
printf("VOCPLAY stopped.\n");
AIL_shutdown(NULL);
}