grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / AHI / Docs / ahidev.html
blobeb753766377ddf2dae2d6924595934e18446a97e
1 <HTML>
2 <HEAD>
3 <!-- This HTML file has been created by texi2html 1.51
4 from ahidev.texinfo on 27 December 2000 -->
6 <TITLE>Ahi Developers's Guide</TITLE>
7 </HEAD>
8 <BODY>
9 <H1>AHI</H1>
10 <H2>Hardware independent audio for Amiga</H2>
11 <H2>AHI Developer's Guide for AHI release </H2>
12 <H2>Document version </H2>
13 <ADDRESS>Martin 'Leviticus' Blom</ADDRESS>
14 <P>
15 <P><HR><P>
16 <H1>Table of Contents</H1>
17 <UL>
18 <LI><A NAME="TOC1" HREF="ahidev.html#SEC1">Overview</A>
19 <LI><A NAME="TOC2" HREF="ahidev.html#SEC2">Distribution</A>
20 <LI><A NAME="TOC3" HREF="ahidev.html#SEC3">The Author</A>
21 <LI><A NAME="TOC4" HREF="ahidev.html#SEC4">Definitions</A>
22 <LI><A NAME="TOC5" HREF="ahidev.html#SEC5">Function Interface</A>
23 <UL>
24 <LI><A NAME="TOC6" HREF="ahidev.html#SEC6">Guidelines</A>
25 <UL>
26 <LI><A NAME="TOC7" HREF="ahidev.html#SEC7">Follow The Rules</A>
27 <LI><A NAME="TOC8" HREF="ahidev.html#SEC8">The Library Base</A>
28 <LI><A NAME="TOC9" HREF="ahidev.html#SEC9">The Audio Database</A>
29 <LI><A NAME="TOC10" HREF="ahidev.html#SEC10">User Hooks</A>
30 <LI><A NAME="TOC11" HREF="ahidev.html#SEC11">Function Calls From Other Tasks, Interrupts Or User Hooks</A>
31 <LI><A NAME="TOC12" HREF="ahidev.html#SEC12">Multitasking</A>
32 </UL>
33 <LI><A NAME="TOC13" HREF="ahidev.html#SEC13">Opening And Closing <CODE>ahi.device</CODE> For Low-level Access</A>
34 <UL>
35 <LI><A NAME="TOC14" HREF="ahidev.html#SEC14"><CODE>Assembler</CODE></A>
36 <LI><A NAME="TOC15" HREF="ahidev.html#SEC15"><CODE>C</CODE></A>
37 </UL>
38 <LI><A NAME="TOC16" HREF="ahidev.html#SEC16">Obtaining The Hardware</A>
39 <UL>
40 <LI><A NAME="TOC17" HREF="ahidev.html#SEC17"><CODE>AHI_AllocAudioA()</CODE> Tags</A>
41 </UL>
42 <LI><A NAME="TOC18" HREF="ahidev.html#SEC18">Declaring Sounds</A>
43 <LI><A NAME="TOC19" HREF="ahidev.html#SEC19">Making Noise</A>
44 <UL>
45 <LI><A NAME="TOC20" HREF="ahidev.html#SEC20">Playing A Sound</A>
46 <LI><A NAME="TOC21" HREF="ahidev.html#SEC21">Playing One-shot Sounds And Advanced Loops</A>
47 <LI><A NAME="TOC22" HREF="ahidev.html#SEC22">Tricks With The Volume</A>
48 </UL>
49 </UL>
50 <LI><A NAME="TOC23" HREF="ahidev.html#SEC23">Device Interface</A>
51 <UL>
52 <LI><A NAME="TOC24" HREF="ahidev.html#SEC24">Opening And Closing <CODE>ahi.device</CODE> For High-level Access</A>
53 <LI><A NAME="TOC25" HREF="ahidev.html#SEC25">Reading From The Device</A>
54 <UL>
55 <LI><A NAME="TOC26" HREF="ahidev.html#SEC26">Double Buffering</A>
56 <LI><A NAME="TOC27" HREF="ahidev.html#SEC27">Distortion</A>
57 </UL>
58 <LI><A NAME="TOC28" HREF="ahidev.html#SEC28">Writing To The Device</A>
59 <UL>
60 <LI><A NAME="TOC29" HREF="ahidev.html#SEC29">Double Buffering</A>
61 <LI><A NAME="TOC30" HREF="ahidev.html#SEC30">Distortion</A>
62 <LI><A NAME="TOC31" HREF="ahidev.html#SEC31">Playing multiple sounds at the same time</A>
63 <LI><A NAME="TOC32" HREF="ahidev.html#SEC32">Suggested precedences</A>
64 </UL>
65 </UL>
66 <LI><A NAME="TOC33" HREF="ahidev.html#SEC33">Data Types And Structures</A>
67 <UL>
68 <LI><A NAME="TOC34" HREF="ahidev.html#SEC34">Data Types</A>
69 <UL>
70 <LI><A NAME="TOC35" HREF="ahidev.html#SEC35"><CODE>Fixed</CODE></A>
71 <LI><A NAME="TOC36" HREF="ahidev.html#SEC36"><CODE>sposition</CODE></A>
72 </UL>
73 <LI><A NAME="TOC37" HREF="ahidev.html#SEC37">Structures</A>
74 <UL>
75 <LI><A NAME="TOC38" HREF="ahidev.html#SEC38"><CODE>AHIUnitPrefs</CODE> And <CODE>AHIGlobalPrefs</CODE></A>
76 </UL>
77 </UL>
78 <LI><A NAME="TOC39" HREF="ahidev.html#SEC39">GNU GENERAL PUBLIC LICENSE</A>
79 <UL>
80 <LI><A NAME="TOC40" HREF="ahidev.html#SEC40">Preamble</A>
81 <LI><A NAME="TOC41" HREF="ahidev.html#SEC41">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A>
82 <LI><A NAME="TOC42" HREF="ahidev.html#SEC42">How to Apply These Terms to Your New Programs</A>
83 </UL>
84 <LI><A NAME="TOC43" HREF="ahidev.html#SEC43">GNU LIBRARY GENERAL PUBLIC LICENSE</A>
85 <UL>
86 <LI><A NAME="TOC44" HREF="ahidev.html#SEC44">Preamble</A>
87 <LI><A NAME="TOC45" HREF="ahidev.html#SEC45">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A>
88 <LI><A NAME="TOC46" HREF="ahidev.html#SEC46">How to Apply These Terms to Your New Libraries</A>
89 </UL>
90 <LI><A NAME="TOC47" HREF="ahidev.html#SEC47">Concept Index</A>
91 <LI><A NAME="TOC48" HREF="ahidev.html#SEC48">Data Type Index</A>
92 <LI><A NAME="TOC49" HREF="ahidev.html#SEC49">Function Index</A>
93 <LI><A NAME="TOC50" HREF="ahidev.html#SEC50">Variable Index</A>
94 </UL>
95 <P><HR><P>
97 <H1>AHI Developer's Guide</H1>
99 <P>
100 For AHI release . Document version .
102 </P>
104 Copyright (C) 1994-1999 Martin Blom
106 </P>
108 The latest release of AHI can always be found at
109 @url{http://www.lysator.liu.se/~lcs/ahi.html}.
111 </P>
115 <H1><A NAME="SEC1" HREF="ahidev.html#TOC1">Overview</A></H1>
118 <A NAME="IDX1"></A>
120 </P>
122 This document was written in order to make it easier for developers to
123 understand and use AHI in their own productions, and write Software
124 That Works(TM).
126 </P>
128 <CODE>ahi.device</CODE> has two different API's; one library-like function
129 interface (low-level), and one "normal" device interface (high-level).
130 Each of them serves different purposes. The low-level interface is
131 targeting music players, games and real-time applications. The high-level
132 interface is targeting applications that just want to have a sample played,
133 play audio streams or record samples as easily as possible.
135 </P>
137 As with everything else, it is important that you chose the right tool for
138 the job--you'll only get frustrated otherwise.
140 </P>
142 Not everything about AHI is documented here; for more information, see
143 <CITE>AHI User's Guide</CITE> and the autodocs.
145 </P>
149 <H1><A NAME="SEC2" HREF="ahidev.html#TOC2">Distribution</A></H1>
152 <A NAME="IDX2"></A>
153 <A NAME="IDX3"></A>
154 <A NAME="IDX4"></A>
155 <A NAME="IDX5"></A>
156 <A NAME="IDX6"></A>
157 <A NAME="IDX7"></A>
159 </P>
161 Copyright (C) 1994-1999 Martin Blom
163 </P>
165 AHI is available under a dual license. The device itself is under
166 the "GNU Library General Public License" (see section <A HREF="ahidev.html#SEC43">GNU LIBRARY GENERAL PUBLIC LICENSE</A>), while the
167 utility programs and the <CODE>AUDIO:</CODE> device is covered by the "GNU General
168 Public License" (see section <A HREF="ahidev.html#SEC39">GNU GENERAL PUBLIC LICENSE</A>).
170 </P>
172 If you use this software in a commercial or shareware product, please
173 consider giving the author (see section <A HREF="ahidev.html#SEC3">The Author</A>)---and preferably each one
174 of the contributors too (see <CITE>AHI User's Guide</CITE>)---an original or
175 registered copy or sample of your work. Should you want to distribute the
176 AHI software with your own product, there is really nothing to
177 consider, right?
179 </P>
183 <H1><A NAME="SEC3" HREF="ahidev.html#TOC3">The Author</A></H1>
186 <A NAME="IDX8"></A>
187 <A NAME="IDX9"></A>
189 </P>
191 The author can be reached at the following addresses:
193 </P>
194 <DL COMPACT>
196 <DT>Electronic mail
197 <DD>
198 @email{martin@blom.org}
200 <DT>Standard mail
201 <DD>
202 Martin Blom
203 <BR>Alsättersgatan 15A:24
204 <BR>SE-584 35 Linköping
205 <BR>SWEDEN
207 <DT>World-Wide Web
208 <DD>
209 @url{http://martin.blom.org}
211 </DL>
215 <H1><A NAME="SEC4" HREF="ahidev.html#TOC4">Definitions</A></H1>
218 <A NAME="IDX10"></A>
220 </P>
222 Following are some general definitions of terms that are used in this
223 document.
225 </P>
226 <DL COMPACT>
228 <DT><STRONG>Sample</STRONG>
229 <DD>
230 <A NAME="IDX11"></A>
232 A sample is one binary number, representing the amplitude at a fixed point
233 in time. A sample is often stored as an 8 bit signed integer, a 16 bit
234 signed integer, a 32 bit floating point number etc. AHI only
235 supports integers.
237 <A NAME="IDX12"></A>
239 <DT><STRONG>Sample frame</STRONG>
240 <DD>
241 In mono environments, a sample frame is the same as a sample. In stereo
242 environments, a sample frame is a tuple of two samples. The first member
243 is for the left channel, the second for the right.
245 <A NAME="IDX13"></A>
247 <DT><STRONG>Sound</STRONG>
248 <DD>
249 Many sample frames stored in sequence as an array can be called a sound. A
250 sound is, however, not limited to being formed by samples, it can also be
251 parameters to an analog synth or a MIDI instrument, or be white noise.
252 AHI only supports sounds formed by samples.
254 </DL>
258 <H1><A NAME="SEC5" HREF="ahidev.html#TOC5">Function Interface</A></H1>
261 <A NAME="IDX14"></A>
263 </P>
265 The device has, in addition to the usual I/O request protocol, a set of
266 functions that allows the programmer to gain full control (at least as much
267 as possible with device independence) over the audio hardware. The
268 advantages are low overhead and much more advanced control over the playing
269 sounds. The disadvantages are greater complexity and only one user per
270 sound card.
272 </P>
274 <A NAME="IDX15"></A>
275 <A NAME="IDX16"></A>
276 <A NAME="IDX17"></A>
277 <A NAME="IDX18"></A>
278 <A NAME="IDX19"></A>
279 <A NAME="IDX20"></A>
281 </P>
283 If you want to play music or sound effects for a game, record in high
284 quality or want to do realtime effects, this is the API to use.
286 </P>
290 <H2><A NAME="SEC6" HREF="ahidev.html#TOC6">Guidelines</A></H2>
293 <A NAME="IDX21"></A>
294 <A NAME="IDX22"></A>
296 </P>
300 <H3><A NAME="SEC7" HREF="ahidev.html#TOC7">Follow The Rules</A></H3>
303 It's really simple. If I tell you to check return values, check sample
304 types when recording, not to trash d2-d7/a2-a6 in hooks, or not to call
305 <CODE>AHI_ControlAudio()</CODE> with the <CODE>AHIC_Play</CODE> tag from interrupts or
306 hooks, you do as you are told.
308 </P>
312 <H3><A NAME="SEC8" HREF="ahidev.html#TOC8">The Library Base</A></H3>
315 <A NAME="IDX23"></A>
316 <A NAME="IDX24"></A>
318 </P>
320 The <CODE>AHIBase</CODE> structure is private, so are the sub libraries' library
321 base structures. Don't try to be clever.
323 </P>
327 <H3><A NAME="SEC9" HREF="ahidev.html#TOC9">The Audio Database</A></H3>
330 <A NAME="IDX25"></A>
332 </P>
334 <A NAME="IDX26"></A>
335 <A NAME="IDX27"></A>
336 <A NAME="IDX28"></A>
338 </P>
340 The implementation of the database is private, and may change any time.
341 <CODE>ahi.device</CODE> provides functions access the information in the database
342 (<CODE>AHI_NextAudioID()</CODE>, <CODE>AHI_GetAudioAttrsA()</CODE> and
343 <CODE>AHI_BestAudioIDA()</CODE>).
345 </P>
349 <H3><A NAME="SEC10" HREF="ahidev.html#TOC10">User Hooks</A></H3>
352 <A NAME="IDX29"></A>
354 </P>
356 All user hooks must follow normal register conventions, which means that
357 d2-d7 and a2-a6 must be preserved. They may be called from an interrupt,
358 but you cannot count on that; it can be your own process or another
359 process. Don't assume the system is in single-thread mode. Never spend
360 much time in a hook, get the work done as quick as possible and then
361 return.
363 </P>
367 <H3><A NAME="SEC11" HREF="ahidev.html#TOC11">Function Calls From Other Tasks, Interrupts Or User Hooks</A></H3>
370 The <CODE>AHIAudioCtrl</CODE> structure may not be shared with other
371 tasks/threads. The task that called <CODE>AHI_AllocAudioA()</CODE> must do all
372 other calls too (except those callable from interrupts).
374 </P>
376 Only calls specifically said to be callable from interrupts may be called
377 from user hooks or interrupts. Note that <CODE>AHI_ControlAudioA()</CODE> has
378 some tags that must not be present when called from an interrupt.
380 </P>
384 <H3><A NAME="SEC12" HREF="ahidev.html#TOC12">Multitasking</A></H3>
387 <A NAME="IDX30"></A>
389 </P>
391 Most audio drivers need multitasking to be turned on to function properly.
392 Don't turn it off while using the device.
394 </P>
398 <H2><A NAME="SEC13" HREF="ahidev.html#TOC13">Opening And Closing <CODE>ahi.device</CODE> For Low-level Access</A></H2>
401 Not too hard. Just open <CODE>ahi.device</CODE> unit <CODE>AHI_NO_UNIT</CODE> and
402 initialize <CODE>AHIBase</CODE>. After that you can access all the functions of
403 the device just as if you had opened a standard shared library.
405 </P>
409 <H3><A NAME="SEC14" HREF="ahidev.html#TOC14"><CODE>Assembler</CODE></A></H3>
412 For the assembler programmer there are two handy macros: <CODE>OPENAHI</CODE>
413 and <CODE>CLOSEAHI</CODE>. Here is a small example how to use them:
415 </P>
417 <PRE>
418 OPENAHI 4 ;Open at least version 4.
419 lea _AHIBase(pc),a0
420 move.l d0,(a0)
421 beq error
423 ; AHI's functions can now be called as normal library functions:
424 move.l _AHIBase(pc),a6
425 moveq #AHI_INVALID_ID,d0
426 jsr _LVOAHI_NextAudioID(a6)
428 error:
429 CLOSEAHI
431 </PRE>
434 Note that you <STRONG>have</STRONG> to execute the <CODE>CLOSEAHI</CODE> macro even if
435 <CODE>OPENAHI</CODE> failed!
437 </P>
441 <H3><A NAME="SEC15" HREF="ahidev.html#TOC15"><CODE>C</CODE></A></H3>
444 For the C programmer, here is how it should be done:
446 </P>
449 <PRE>
450 struct Library *AHIBase;
451 struct MsgPort *AHImp=NULL;
452 struct AHIRequest *AHIio=NULL;
453 BYTE AHIDevice=-1;
455 if(AHImp = CreateMsgPort())
457 if(AHIio = (struct AHIRequest *) CreateIORequest(
458 AHImp, sizeof(struct AHIRequest)))
460 AHIio-&#62;ahir_Version = 4; /* Open at least version 4. */
461 if(!(AHIDevice = OpenDevice(AHINAME, AHI_NO_UNIT,
462 (struct IORequest *) AHIio, NULL)))
464 AHIBase = (struct Library *) AHIio-&#62;ahir_Std.io_Device;
466 // AHI's functions can now be called as normal library functions:
467 AHI_NextAudioID(AHI_INVALID_ID);
469 CloseDevice((struct IORequest *) AHIio);
470 AHIDevice = -1;
472 DeleteIORequest((struct IORequest *) AHIio);
473 AHIio = NULL;
475 DeleteMsgPort(AHImp);
476 AHImp = NULL;
478 </PRE>
482 <H2><A NAME="SEC16" HREF="ahidev.html#TOC16">Obtaining The Hardware</A></H2>
485 If you wish to call any other function than
487 </P>
489 <UL>
491 <LI>
493 <CODE>AHI_AllocAudioRequestA()</CODE>
495 <LI>
497 <CODE>AHI_AudioRequestA()</CODE>
499 <LI>
501 <CODE>AHI_BestAudioIDA()</CODE>
503 <LI>
505 <CODE>AHI_FreeAudioRequest()</CODE>
507 <LI>
509 <CODE>AHI_GetAudioAttrsA()</CODE>
511 <LI>
513 <CODE>AHI_NextAudioID()</CODE>
515 <LI>
517 <CODE>AHI_SampleFrameSize()</CODE>
519 </UL>
522 <A NAME="IDX31"></A>
523 <A NAME="IDX32"></A>
524 <A NAME="IDX33"></A>
526 </P>
528 ...you have to allocate the actual sound hardware. This is done with
529 <CODE>AHI_AllocAudioA()</CODE>. <CODE>AHI_AllocAudioA()</CODE> returns an
530 <CODE>AHIAudioCtrl</CODE> structure, or <CODE>NULL</CODE> if the hardware could not be
531 allocated. The <CODE>AHIAudioCtrl</CODE> structure has only one public field,
532 <CODE>ahiac_UserData</CODE>. This is unused by AHI and you may store
533 anything you like here.
535 </P>
537 If <CODE>AHI_AllocAudioA()</CODE> fails it is important that you handle the
538 situation gracefully.
540 </P>
542 <A NAME="IDX34"></A>
544 </P>
546 When you are finished playing or recording, call <CODE>AHI_FreeAudio()</CODE> to
547 deallocate the hardware and other resources allocated by
548 <CODE>AHI_AllocAudioA()</CODE>. <CODE>AHI_FreeAudio()</CODE> also deallocates all
549 loaded sounds (see section <A HREF="ahidev.html#SEC18">Declaring Sounds</A>).
551 </P>
555 <H3><A NAME="SEC17" HREF="ahidev.html#TOC17"><CODE>AHI_AllocAudioA()</CODE> Tags</A></H3>
558 <CODE>AHI_AllocAudioA()</CODE> takes several tags as input.
560 </P>
561 <DL COMPACT>
563 <DT><CODE>AHIA_AudioID</CODE>
564 <DD>
565 <A NAME="IDX35"></A>
567 <A NAME="IDX36"></A>
568 This is the audio mode to be used. You must not use any hardcoded values
569 other than <CODE>AHI_DEFAULT_ID</CODE>, which is the user's default fallback ID.
570 In most cases you should ask the user for an ID code (with
571 <CODE>AHI_AudioRequestA()</CODE>) and then store the value in your settings file.
573 <A NAME="IDX37"></A>
575 <DT><CODE>AHIA_MixFreq</CODE>
576 <DD>
577 <A NAME="IDX38"></A>
578 This is the mixing frequency to be used. The actual frequency will be
579 rounded to the nearest frequency supported by the sound hardware. To find
580 the actual frequency, use <CODE>AHI_GetAudioAttrsA()</CODE>. If omitted or
581 <CODE>AHI_DEFAULT_FREQ</CODE>, the user's preferred fallback frequency will be
582 used. In most cases you should ask the user for a frequency (with
583 <CODE>AHI_AudioRequestA()</CODE>) and then store the value in your settings file.
585 <DT><CODE>AHIA_Channels</CODE>
586 <DD>
587 <A NAME="IDX39"></A>
588 All sounds are played on a <STRONG>channel</STRONG>, and this tag selects how many you
589 wish to use. In general it takes more CPU power the more channels you use
590 and the volume gets lower and lower.
592 <DT><CODE>AHIA_Sounds</CODE>
593 <DD>
594 <A NAME="IDX40"></A>
595 You must tell AHI how many different sounds you are going to play.
596 See section <A HREF="ahidev.html#SEC18">Declaring Sounds</A> for more information.
598 <A NAME="IDX41"></A>
599 <A NAME="IDX42"></A>
601 <DT><CODE>AHIA_SoundFunc</CODE>
602 <DD>
603 <A NAME="IDX43"></A>
604 With this tag you tell AHI to call a hook when a sound has been
605 started. It works just like Paula's audio interrupts. The hook receives an
606 <CODE>AHISoundMessage</CODE> structure as message.
607 <CODE>AHISoundMessage-&#62;ahism_Channel</CODE> indicates which channel the sound
608 that caused the hook to be called is played on.
610 <DT><CODE>AHIA_PlayerFunc</CODE>
611 <DD>
612 <A NAME="IDX44"></A>
613 If you are going to play a musical score, you should use this "interrupt"
614 source instead of VBLANK or CIA timers in order to get the best result with
615 all audio drivers. If you cannot use this, you must not use any
616 "non-realtime" modes (see <CODE>AHI_GetAudioAttrsA()</CODE> in the autodocs,
617 the <CODE>AHIDB_Realtime</CODE> tag).
619 <DT><CODE>AHIA_PlayerFreq</CODE>
620 <DD>
621 <A NAME="IDX45"></A>
622 If non-zero, it enables timing and specifies how many times per second
623 <CODE>PlayerFunc</CODE> will be called. This must be specified if
624 <CODE>AHIA_PlayerFunc</CODE> is! It is suggested that you keep the frequency
625 below 100-200 Hz. Since the frequency is a fixpoint number
626 <CODE>AHIA_PlayerFreq</CODE> should be less than 13107200 (that's 200 Hz).
628 <DT><CODE>AHIA_MinPlayerFreq</CODE>
629 <DD>
630 <A NAME="IDX46"></A>
631 The minimum frequency (<CODE>AHIA_PlayerFreq</CODE>) you will use. You should
632 always supply this if you are using the device's interrupt feature!
634 <DT><CODE>AHIA_MaxPlayerFreq</CODE>
635 <DD>
636 <A NAME="IDX47"></A>
637 The maximum frequency (<CODE>AHIA_PlayerFreq</CODE>) you will use. You should
638 always supply this if you are using the device's interrupt feature!
640 <DT><CODE>AHIA_RecordFunc</CODE>
641 <DD>
642 <A NAME="IDX48"></A>
643 This hook will be called regularly when sampling is turned on (see
644 <CODE>AHI_ControlAudioA()</CODE>). It is important that you always check the
645 format of the sampled data, and ignore it if you can't parse it. Since
646 this hook may be called from an interrupt, it is not legal to directly
647 <CODE>Write()</CODE> the buffer to disk. To record directly to harddisk you
648 have to copy the samples to another buffer and signal a process to save it.
649 To find out the required size of the buffer, see
650 <CODE>AHI_GetAudioAttrsA()</CODE> in the autodocs, the
651 <CODE>AHIDB_MaxRecordSamples</CODE> tag.
653 <A NAME="IDX49"></A>
655 <DT><CODE>AHIA_UserData</CODE>
656 <DD>
657 <A NAME="IDX50"></A>
658 Can be used to initialize the <CODE>ahiac_UserData</CODE> field. You do not have
659 to use this tag to change <CODE>ahiac_UserData</CODE>, you may write to it
660 directly.
662 </DL>
666 <H2><A NAME="SEC18" HREF="ahidev.html#TOC18">Declaring Sounds</A></H2>
669 <A NAME="IDX51"></A>
670 <A NAME="IDX52"></A>
672 </P>
674 <A NAME="IDX53"></A>
676 </P>
678 Before you can play a sample array, you must <CODE>AHI_LoadSound()</CODE> it.
679 Why? Because if AHI knows what kind of sounds that will be played
680 later, tables and stuff can be set up in advance. Some drivers may even
681 upload the samples to the sound cards local RAM and play all samples from
682 there, drastically reducing CPU and bus load.
684 </P>
686 You should <CODE>AHI_LoadSound()</CODE> the most important sounds first, since
687 the sound cards RAM may not be large enough to hold all your sounds.
689 </P>
691 <CODE>AHI_LoadSound()</CODE> also associates each sound or sample array with a
692 number, which is later used to refer to that particular sound.
694 </P>
696 There are 2 types of sounds, namely <CODE>AHIST_SAMPLE</CODE> and
697 <CODE>AHIST_DYNAMICSAMPLE</CODE>.
699 </P>
701 <DL COMPACT>
703 <DT><CODE>AHIST_SAMPLE</CODE>
704 <DD>
705 <A NAME="IDX54"></A>
706 This is used for static samples. Most sounds that will be played are of
707 this type. Once the samples have been "loaded", you may not alter the
708 memory where the samples are located. You may, however, read from it.
710 <DT><CODE>AHIST_DYNAMICSAMPLE</CODE>
711 <DD>
712 <A NAME="IDX55"></A>
713 If you wish to play samples that you calculate in realtime, or load in
714 portions from disk, you must use this type. These samples will never be
715 uploaded to a sound cards local RAM, but always played from the normal
716 memory. There is a catch, however. Because of the fact that the sound is
717 mixed in chunks, you must have a certain number of samples in memory before
718 you start a sound of this type. To calculate the size of the buffer (in
719 samples), use the following formula:
722 <PRE>
723 @math{size = samples * Fs / Fm}
724 </PRE>
726 where samples is the value returned from <CODE>AHI_GetAudioAttrsA()</CODE> when
727 called with the <CODE>AHIDB_MaxPlaySamples</CODE> tag, Fs is the highest
728 frequency the sound will be played at and Fm is the actual mixing frequency
729 (<CODE>AHI_ControlAudioA()/AHIC_MixFreq_Query</CODE>).
731 </DL>
734 The samples can be in one of four different formats, named <CODE>AHIST_M8S</CODE>,
735 <CODE>AHIST_S8S</CODE>, <CODE>AHIST_M16S</CODE>, and <CODE>AHIST_S16S</CODE>.
737 </P>
738 <DL COMPACT>
740 <DT><CODE>AHIST_M8S</CODE>
741 <DD>
742 <A NAME="IDX56"></A>
743 This is an 8 bit mono sound. Each sample frame is just one signed byte.
745 <DT><CODE>AHIST_S8S</CODE>
746 <DD>
747 <A NAME="IDX57"></A>
748 This is an 8 bit stereo sound. Each sample frame is one signed byte representing
749 the left channel, followed by another one for the right channel.
751 <DT><CODE>AHIST_M16S</CODE>
752 <DD>
753 <A NAME="IDX58"></A>
754 This is a 16 bit mono sound. Each sample frame is just one signed 16 bit
755 word, in big endian/network order format (most significant byte first).
757 <DT><CODE>AHIST_S16S</CODE>
758 <DD>
759 <A NAME="IDX59"></A>
760 This is a 16 bit stereo sound. Each sample frame is one signed 16 bit
761 word, in big endian/network order format (most significant byte first)
762 representing the left channel, followed by another one for the right
763 channel.
765 </DL>
768 <A NAME="IDX60"></A>
770 </P>
772 If you know that you won't use a sound anymore, call
773 <CODE>AHI_UnloadSound()</CODE>. <CODE>AHI_FreeAudio()</CODE> will also do that for you
774 for any sounds left when called.
776 </P>
778 There is no need to place a sample array in <STRONG>Chip memory</STRONG>, but it
779 <STRONG>must not</STRONG> be swapped out! Allocate your sample memory with the
780 <CODE>MEMF_PUBLIC</CODE> flag set. If you wish to have your samples in virtual
781 memory, you have to write a double-buffer routine that copies a chunk of
782 memory to a <CODE>MEMF_PUBLIC</CODE> buffer. The <STRONG>SoundFunc</STRONG> should signal a
783 task to do the transfer, since it may run in supervisor mode (see
784 <CODE>AHI_AllocAudioA()</CODE>).
786 </P>
790 <H2><A NAME="SEC19" HREF="ahidev.html#TOC19">Making Noise</A></H2>
793 <A NAME="IDX61"></A>
794 <A NAME="IDX62"></A>
796 </P>
798 After you have allocated the sound hardware and declared all your sounds,
799 you're ready to start playback. This is done with a call to
800 <CODE>AHI_ControlAudioA()</CODE>, with the <CODE>AHIC_Play</CODE> tag set to
801 <CODE>TRUE</CODE>. When this function returns the <STRONG>PlayerFunc</STRONG> (see
802 <CODE>AHI_AllocAudioA()</CODE>) is active, and the audio driver is feeding
803 silence to the sound hardware.
805 </P>
808 <H3><A NAME="SEC20" HREF="ahidev.html#TOC20">Playing A Sound</A></H3>
811 <A NAME="IDX63"></A>
812 <A NAME="IDX64"></A>
813 <A NAME="IDX65"></A>
815 </P>
817 All you have to do now is to set the desired sound, it's frequency and
818 volume. This is done with <CODE>AHI_SetSound()</CODE>, <CODE>AHI_SetFreq()</CODE> and
819 <CODE>AHI_SetVol()</CODE>. Make sure the <CODE>AHISF_IMM</CODE> flag is set for all
820 these function's <VAR>flag</VAR> argument. And don't try to modify a channel
821 that is out of range! If you have allocated 4 channels you may only modify
822 channels 0-3.
824 </P>
826 The sound will not start until both <CODE>AHI_SetSound()</CODE> and
827 <CODE>AHI_SetFreq()</CODE> have been called. The sound will play even if
828 <CODE>AHI_SetVol()</CODE> was not called, but it will play completely silent. If
829 you wish to temporary stop a sound, set its frequency to 0. When you
830 change the frequency again, the sound will continue where it was.
832 </P>
834 <A NAME="IDX66"></A>
836 </P>
838 When the sound has been started it will play to the end and then repeat.
839 In order to play a one-shot sound you have use the <CODE>AHI_PlayA()</CODE>
840 function, or install a sound interrupt using the <CODE>AHIA_SoundFunc</CODE> tag
841 with <CODE>AHI_AllocAudioA()</CODE>. For more information about using sound
842 interrupts, see below.
844 </P>
846 A little note regarding <CODE>AHI_SetSound()</CODE>: <VAR>Offset</VAR> is the first
847 sample frame that will be played, both when playing backwards and forwards.
848 This means that if you call <CODE>AHI_SetSound()</CODE> with <VAR>offset</VAR> 0 and
849 <VAR>length</VAR> 4, sample fram 0, 1, 2 and 3 will be played. If you call
850 <CODE>AHI_SetSound()</CODE> with <VAR>offset</VAR> 3 and <VAR>length</VAR> -4,
851 sample frame 3, 2, 1 and 0 will be played.
853 </P>
855 Also note that playing very short sounds will be very CPU intensive, since
856 there are many tasks that must be done each time a sound has reached its
857 end (like starting the next one, calling the <STRONG>SoundFunc</STRONG>, etc.).
858 Therefore, it is recommended that you "unroll" short sounds a couple of
859 times before you play them. How many times you should unroll? Well, it
860 depends on the situation, of course, but try making the sound a thousand
861 samples long if you can. Naturally, if you need your <STRONG>SoundFunc</STRONG> to
862 be called, you cannot unroll.
864 </P>
867 <H3><A NAME="SEC21" HREF="ahidev.html#TOC21">Playing One-shot Sounds And Advanced Loops</A></H3>
870 <A NAME="IDX67"></A>
872 </P>
874 In version 4, some changes have been made since earlier releases.
875 One-shot sounds and sounds with only one loop segment can now be played
876 without using sample interrupts. This is possible because one of the
877 restrictions regarding the <CODE>AHISF_IMM</CODE> flag has been removed.
879 </P>
881 The <CODE>AHISF_IMM</CODE> flag determines if <CODE>AHI_SetSound()</CODE>,
882 <CODE>AHI_SetFreq()</CODE> and <CODE>AHI_SetVol()</CODE> should take effect immediately
883 or when the current sound has reached its end. The rules for this flags
884 are:
886 </P>
888 <UL>
890 <LI>
892 If used inside a sample interrupt (<STRONG>SoundFunc</STRONG>): Must be cleared.
894 <LI>
896 If used inside a player interrupt (<STRONG>PlayerFunc</STRONG>): May be set or
897 cleared.
899 <LI>
901 If used elsewhere: Must be set.
903 </UL>
906 What does this mean? It means that if all you want to do is to play a
907 one-shot sound from inside a <STRONG>PlayerFunc</STRONG>, you can do that by first
908 calling <CODE>AHI_SetSound()</CODE>, <CODE>AHI_SetFreq()</CODE> and <CODE>AHI_SetVol()</CODE>
909 with <CODE>AHISF_IMM</CODE> set, and then use <CODE>AHI_SetSound(ch, AHI_NOSOUND,
910 0, 0, actrl, 0L)</CODE> to stop the sound when it has reached the end. You can
911 also set one loop segment this way.
913 </P>
915 <CODE>AHI_PlayA()</CODE> was added in AHI version 4, and combines
916 <CODE>AHI_SetSound()</CODE>, <CODE>AHI_SetFreq()</CODE> and <CODE>AHI_SetVol()</CODE> into
917 one tag-based function. It also allows you to set one loop and play
918 one-shot sounds.
920 </P>
922 To play a sound with more than one loop segment or ping-pong looping, a
923 sample interrupt needs to be used. AHI's <STRONG>SoundFunc</STRONG> works like Paula's
924 interrupts and is very easy to use.
926 </P>
928 The <STRONG>SoundFunc</STRONG> hook will be called with an <CODE>AHIAudioCtrl</CODE>
929 structure as object and an <CODE>AHISoundMessage</CODE> structure as message.
930 <CODE>ahism_Channel</CODE> indicates which channel caused the hook to be called.
932 </P>
934 An example <STRONG>SoundFunc</STRONG> which handles the repeat part of an instrument
935 can look like this (SAS/C code):
937 </P>
939 <PRE>
940 __asm __saveds ULONG SoundFunc(register __a0 struct Hook *hook,
941 register __a2 struct AHIAudioCtrl *actrl,
942 register __a1 struct AHISoundMessage *chan)
944 if(ChannelDatas[chan-&#62;ahism_Channel].Length)
945 AHI_SetSound(chan-&#62;ahism_Channel, 0,
946 (ULONG) ChannelDatas[chan-&#62;ahism_Channel].Address,
947 ChannelDatas[chan-&#62;ahism_Channel].Length,
948 actrl, NULL);
949 else
950 AHI_SetSound(chan-&#62;ahism_Channel, AHI_NOSOUND,
951 NULL, NULL, actrl, NULL);
952 return NULL;
954 </PRE>
957 This example is from an old version of the AHI NotePlayer for
958 <STRONG>DeliTracker 2</STRONG>. <CODE>ChannelDatas</CODE> is an array where the start and
959 length of the repeat part is stored. Here, a repeat length of zero
960 indicates a one-shot sound. Note that this particular example only uses
961 one sound (0). For applications using multiple sounds, the sound number
962 would have to be stored in the array as well.
964 </P>
966 Once again, note that the <CODE>AHISF_IMM</CODE> flag should <STRONG>never</STRONG> be
967 set in a <STRONG>SoundFunc</STRONG> hook!
969 </P>
973 <H3><A NAME="SEC22" HREF="ahidev.html#TOC22">Tricks With The Volume</A></H3>
976 <A NAME="IDX68"></A>
978 </P>
980 Starting with V4, <CODE>AHI_SetVol()</CODE> can take both negative volume and
981 pan parameters. If you set the volume to a negative value, the sample
982 will, if the audio mode supports it, invert each sample before playing. If
983 pan is negative, the sample will be encoded to go to the surround speakers.
985 </P>
989 <H1><A NAME="SEC23" HREF="ahidev.html#TOC23">Device Interface</A></H1>
992 <A NAME="IDX69"></A>
993 <A NAME="IDX70"></A>
994 <A NAME="IDX71"></A>
995 <A NAME="IDX72"></A>
996 <A NAME="IDX73"></A>
998 </P>
1000 The I/O request protocol makes it very easy to play audio streams, sounds
1001 from disk and non time-critical sound effects in a multitasking friendly
1002 way. Recoding is just as easy, on behalf of quality. Several programs can
1003 play sounds at the same time, and even record at the same time if your
1004 hardware is full duplex.
1006 </P>
1008 If you want to write a sample player, play (warning?) sounds in your
1009 applications, play an audio stream from a CD via the SCSI/IDE bus, write a
1010 voice command utility etc., this is the API to use.
1012 </P>
1014 Note that while all the low-level functions (see section <A HREF="ahidev.html#SEC5">Function Interface</A>)
1015 count lengths and offsets in sample frames, the device interface--like all
1016 Amiga devices--uses bytes.
1018 </P>
1022 <H2><A NAME="SEC24" HREF="ahidev.html#TOC24">Opening And Closing <CODE>ahi.device</CODE> For High-level Access</A></H2>
1025 Four primary steps are required to open ahi.device:
1027 </P>
1029 <UL>
1031 <LI>
1033 Create a message port using <CODE>CreateMsgPort()</CODE>. Reply messages from
1034 the device must be directed to a message port.
1036 <A NAME="IDX74"></A>
1038 <LI>
1040 Create an extended I/O request structure of type <CODE>AHIRequest</CODE> using
1041 <CODE>CreateIORequest()</CODE>. <CODE>CreateIORequest()</CODE> will initialize the I/O
1042 request to point to your reply port.
1044 <LI>
1046 Specify which version of the device you need. The lowest supported version
1047 is 4. Version 1 and 3 are obsolete, and version 2 only has the low-level
1048 API.
1050 <A NAME="IDX75"></A>
1052 <LI>
1054 Open <CODE>ahi.device</CODE> unit <CODE>AHI_DEFAULT_UNIT</CODE> or any other unit the
1055 user has specified with, for example, a <VAR>UNIT</VAR> tooltype. Call
1056 <CODE>OpenDevice()</CODE>, passing the I/O request.
1058 </UL>
1061 Each <CODE>OpenDevice()</CODE> must eventually be matched by a call to
1062 <CODE>CloseDevice()</CODE>. When the last close is performed, the device will
1063 deallocate all resources.
1065 </P>
1067 All I/O requests must be completed before <CODE>CloseDevice()</CODE>. Abort any
1068 pending requests with <CODE>AbortIO()</CODE>.
1070 </P>
1072 Example:
1074 </P>
1076 <PRE>
1077 struct MsgPort *AHImp = NULL;
1078 struct AHIRequest *AHIio = NULL;
1079 BYTE AHIDevice = -1;
1080 UBYTE unit = AHI_DEFAULT_UNIT;
1082 /* Check if user wants another unit here... */
1084 if(AHImp = CreateMsgPort())
1086 if(AHIio = (struct AHIRequest *)
1087 CreateIORequest(AHImp, sizeof(struct AHIRequest)))
1089 AHIio-&#62;ahir_Version = 4;
1090 if(!(AHIDevice = OpenDevice(AHINAME, unit,
1091 (struct IORequest *) AHIio, NULL)))
1094 /* Send commands to the device here... */
1096 if(! CheckIO((struct IORequest *) AHIio))
1098 AbortIO((struct IORequest *) AHIio);
1101 WaitIO((struct IORequest *) AHIio);
1103 CloseDevice((struct IORequest *) AHIio);
1104 AHIDevice = -1;
1106 DeleteIORequest((struct IORequest *) AHIio);
1107 AHIio = NULL;
1109 DeleteMsgPort(AHImp);
1110 AHImp = NULL;
1112 </PRE>
1116 <H2><A NAME="SEC25" HREF="ahidev.html#TOC25">Reading From The Device</A></H2>
1119 <A NAME="IDX76"></A>
1120 <A NAME="IDX77"></A>
1122 </P>
1124 <A NAME="IDX78"></A>
1125 <A NAME="IDX79"></A>
1126 <A NAME="IDX80"></A>
1127 <A NAME="IDX81"></A>
1128 <A NAME="IDX82"></A>
1129 <A NAME="IDX83"></A>
1130 <A NAME="IDX84"></A>
1131 <A NAME="IDX85"></A>
1133 </P>
1135 You read from <CODE>ahi.device</CODE> by passing an <CODE>AHIRequest</CODE> to the
1136 device with <CODE>CMD_READ</CODE> set in <CODE>io_Command</CODE>, the number of bytes
1137 to be read set in <CODE>io_Length</CODE>, the address of the read buffer set in
1138 <CODE>io_Data</CODE>, the desired sample format set in <CODE>ahir_Type</CODE> and the
1139 desired sample frequency set in <CODE>ahir_Frequency</CODE>. The first read
1140 command in a sequence should also have <CODE>io_Offset</CODE> set to 0.
1141 <CODE>io_Length</CODE> must be an even multiple of the sample frame size.
1143 </P>
1146 <H3><A NAME="SEC26" HREF="ahidev.html#TOC26">Double Buffering</A></H3>
1149 <A NAME="IDX86"></A>
1151 </P>
1153 To do double buffering, just fill the first buffer with <CODE>DoIO()</CODE> and
1154 <CODE>io_Offset</CODE> set to 0, then start filling the second buffer with
1155 <CODE>SendIO()</CODE> using the same I/O request (but don't clear
1156 <CODE>io_Offset</CODE>!). After you have processed the first buffer, wait until
1157 the I/O request is finished and start over with <CODE>SendIO()</CODE> on the
1158 first buffer.
1160 </P>
1163 <H3><A NAME="SEC27" HREF="ahidev.html#TOC27">Distortion</A></H3>
1166 <A NAME="IDX87"></A>
1168 </P>
1170 The samples will automatically be converted to the sample format set in
1171 <CODE>ahir_Type</CODE> and to the sample frequency set in <CODE>ahir_Frequency</CODE>.
1172 Because it is quite unlikely that you ask for the same sample frequency the
1173 user has chosen in the preference program, chances that the quality is
1174 lower than expected are pretty high. The worst problem is probably the
1175 anti-aliasing filter before the A/D converter. If the user has selected a
1176 higher sampling/mixing frequency than you request, the signal will be
1177 distorted according to the Nyquist sampling theorem. If, on the other
1178 hand, the user has selected a lower sampling/mixing frequency than you
1179 request, the signal will not be distorted but rather bandlimited more than
1180 necessary.
1182 </P>
1186 <H2><A NAME="SEC28" HREF="ahidev.html#TOC28">Writing To The Device</A></H2>
1189 <A NAME="IDX88"></A>
1190 <A NAME="IDX89"></A>
1192 </P>
1194 <A NAME="IDX90"></A>
1195 <A NAME="IDX91"></A>
1196 <A NAME="IDX92"></A>
1197 <A NAME="IDX93"></A>
1198 <A NAME="IDX94"></A>
1199 <A NAME="IDX95"></A>
1200 <A NAME="IDX96"></A>
1201 <A NAME="IDX97"></A>
1202 <A NAME="IDX98"></A>
1203 <A NAME="IDX99"></A>
1204 <A NAME="IDX100"></A>
1206 </P>
1209 You write to the device by passing an <CODE>AHIRequest</CODE> to the device with
1210 <CODE>CMD_WRITE</CODE> set in <CODE>io_Command</CODE>, the precedence in
1211 <CODE>io_Message.mn_Node.ln_Pri</CODE>, the number of bytes to be written in
1212 <CODE>io_Length</CODE>, the address of the write buffer set in <CODE>io_Data</CODE>,
1213 the sample format set in <CODE>ahir_Type</CODE>, the desired sample frequency set
1214 in <CODE>ahir_Frequency</CODE>, the desired volume set in <CODE>ahir_Volume</CODE> and
1215 the desired stereo position set in <CODE>ahir_Position</CODE>. Unless you are
1216 doing double buffering, <CODE>ahir_Link</CODE> should be set to <CODE>NULL</CODE>.
1217 <CODE>io_Length</CODE> must be an even multiple of the sample frame size.
1219 </P>
1222 <H3><A NAME="SEC29" HREF="ahidev.html#TOC29">Double Buffering</A></H3>
1225 <A NAME="IDX101"></A>
1227 </P>
1229 To do double buffering, you need two I/O requests. Create the second one
1230 by making a copy of the request you used in <CODE>OpenDevice()</CODE>. Start the
1231 first with <CODE>SendIO()</CODE>. Set <CODE>ahir_Link</CODE> in the second request to
1232 the address of the first request, and <CODE>SendIO()</CODE> it. Wait on the
1233 first, fill the first buffer again and repeat, this time with
1234 <CODE>ahir_Link</CODE> of the first buffer set to the address of the second I/O
1235 request.
1237 </P>
1240 <H3><A NAME="SEC30" HREF="ahidev.html#TOC30">Distortion</A></H3>
1243 <A NAME="IDX102"></A>
1245 </P>
1247 The problems with aliasing are present but not as obvious as with reading.
1248 Just make sure your source data is bandlimited correctly, and do not play
1249 samples at a lower frequency than they were recorded.
1251 </P>
1254 <H3><A NAME="SEC31" HREF="ahidev.html#TOC31">Playing multiple sounds at the same time</A></H3>
1257 If you want to play several sounds at the same time, just make a new copy
1258 of the I/O request you used in <CODE>OpenDevice()</CODE>, and <CODE>CMD_WRITE</CODE>
1259 it. The user has set the number of channels available in the preference
1260 tool, and if too many requests are sent to the device the one with lowest
1261 precedence will be muted. When a request is finished, the muted request
1262 with the highest precedence will be played. Note that all muted requests
1263 continue to play silently, so the programmer will not have to worry if
1264 there are enough channels or not.
1266 </P>
1269 <H3><A NAME="SEC32" HREF="ahidev.html#TOC32">Suggested precedences</A></H3>
1272 <A NAME="IDX103"></A>
1274 </P>
1276 The precedences to use depend on what kind of sound you are playing. The
1277 recommended precedences are the same as for <CODE>audio.device</CODE>, listed in
1278 <CITE>AMIGA ROM Kernel Reference manual -- Devices</CITE>. Reprinted without
1279 permission. So sue me.
1281 </P>
1283 <PRE>
1284 Precedences | Type of sound
1285 -------------+----------------------------------------------------------
1286 127 | Unstoppable. Sounds first allocated at lower
1287 | precedencies, then set to this highest level.
1288 90 - 100 | Emergencies. Alert, urgent situation that requires
1289 | immediate action.
1290 80 - 90 | Annunciators. Attention, bell (CTRL-G).
1291 75 | Speech. Synthesized or recorded speech
1292 | (narrator.device).
1293 50 - 70 | Sonic cues. Sounds that provide information that is not
1294 | provided by graphics. Only the beginning of of each sound
1295 | should be at this level; the rest should ne set to sound
1296 | effects level.
1297 -50 - 50 | Music program. Musical notes in a music-oriented program.
1298 | The higher levels should be used for the attack portions
1299 | of each note.
1300 -70 - -50 | Sound effects. Sounds used in conjunction with graphics.
1301 | More important sounds should use higher levels.
1302 -100 - -80 | Background. Theme music and restartable background sounds.
1303 -128 | Silence. Lowest level (freeing the channel completely is
1304 | preferred).
1305 </PRE>
1308 Right. As you can see, some things do not apply to <CODE>ahi.device</CODE>.
1309 First, there is no way to change the precedence of a playing sound, so the
1310 precedences should be set from the beginning. Second, it is not
1311 recommended to use the device interface to play music. However, playing an
1312 audio stream from CD or disk comes very close. Third, there are no channels
1313 to free in AHI since they are dynamically allocated by the device.
1315 </P>
1319 <H1><A NAME="SEC33" HREF="ahidev.html#TOC33">Data Types And Structures</A></H1>
1322 <A NAME="IDX104"></A>
1324 </P>
1326 In this chapter some of the data types and structures used will be
1327 explained. For more information, please consult the autodocs and the
1328 include files.
1330 </P>
1334 <H2><A NAME="SEC34" HREF="ahidev.html#TOC34">Data Types</A></H2>
1337 <A NAME="IDX105"></A>
1339 </P>
1342 <H3><A NAME="SEC35" HREF="ahidev.html#TOC35"><CODE>Fixed</CODE></A></H3>
1345 <A NAME="IDX106"></A>
1347 </P>
1349 <CODE>Fixed</CODE> is a signed long integer. It is used to represent decimal
1350 numbers without using floating point arithmetics. The decimal point is
1351 assumed to be in the middle of the 32 bit integer, thus giving 16 bits for
1352 the integer part of the number and 16 bits for the fraction. The largest
1353 number that can be stored in a <CODE>Fixed</CODE> is +32767.999984741, and the
1354 lowest number is -32768.
1356 </P>
1358 Example:
1360 </P>
1362 <PRE>
1363 Decimal | Fixed
1364 --------+----------
1365 1.0 | 0x00010000
1366 0.5 | 0x00008000
1367 0.25 | 0x00004000
1368 0 | 0x00000000
1369 -0.25 | 0xffffc000
1370 -0.5 | 0xffff8000
1371 -1.0 | 0xffff0000
1372 </PRE>
1376 <H3><A NAME="SEC36" HREF="ahidev.html#TOC36"><CODE>sposition</CODE></A></H3>
1379 <A NAME="IDX107"></A>
1381 </P>
1383 <CODE>sposition</CODE> (stereo position) is a <CODE>Fixed</CODE>, and is used to
1384 represent the stereo position of a sound. 0 is far left, 0.5 is center and
1385 1.0 is far right.
1387 </P>
1391 <H2><A NAME="SEC37" HREF="ahidev.html#TOC37">Structures</A></H2>
1394 <A NAME="IDX108"></A>
1396 </P>
1399 <H3><A NAME="SEC38" HREF="ahidev.html#TOC38"><CODE>AHIUnitPrefs</CODE> And <CODE>AHIGlobalPrefs</CODE></A></H3>
1402 <A NAME="IDX109"></A>
1403 <A NAME="IDX110"></A>
1405 </P>
1407 These structures are used in the <CODE>AHIU</CODE> and <CODE>AHIG</CODE> chunks,
1408 respective, which are part of the settings file (<TT>`ENV:Sys/ahi.prefs'</TT>),
1409 The file is read by AHI on each call to <CODE>OpenDevice()</CODE>, just
1410 before the audio hardware is allocated.
1412 </P>
1414 <CODE>AHIUnitPrefs</CODE> specifies the audio mode and its parameters to use for
1415 each device unit (currently 0-3 and <CODE>AHI_NO_UNIT</CODE>; unit 0 is also called
1416 <CODE>AHI_DEFAULT_UNIT</CODE>).
1418 </P>
1420 <CODE>AHIGlobalPrefs</CODE> contains some global options that can be used to
1421 gain speed on slow CPUs, the global debug level and a protection against
1422 CPU overload. The debug level specifies which of the functions in AHI
1423 should print debugging information to the serial port (the output can be
1424 redirected to a console window or a file with tools like <STRONG>Sushi</STRONG>
1425 <A NAME="DOCF1" HREF="ahidev.html#FOOT1">(1)</A>.}).
1427 </P>
1431 <H1><A NAME="SEC39" HREF="ahidev.html#TOC39">GNU GENERAL PUBLIC LICENSE</A></H1>
1433 Version 2, June 1991
1435 </P>
1437 <PRE>
1438 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
1439 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1441 Everyone is permitted to copy and distribute verbatim copies
1442 of this license document, but changing it is not allowed.
1443 </PRE>
1447 <H2><A NAME="SEC40" HREF="ahidev.html#TOC40">Preamble</A></H2>
1450 The licenses for most software are designed to take away your
1451 freedom to share and change it. By contrast, the GNU General Public
1452 License is intended to guarantee your freedom to share and change free
1453 software--to make sure the software is free for all its users. This
1454 General Public License applies to most of the Free Software
1455 Foundation's software and to any other program whose authors commit to
1456 using it. (Some other Free Software Foundation software is covered by
1457 the GNU Library General Public License instead.) You can apply it to
1458 your programs, too.
1460 </P>
1462 When we speak of free software, we are referring to freedom, not
1463 price. Our General Public Licenses are designed to make sure that you
1464 have the freedom to distribute copies of free software (and charge for
1465 this service if you wish), that you receive source code or can get it
1466 if you want it, that you can change the software or use pieces of it
1467 in new free programs; and that you know you can do these things.
1469 </P>
1471 To protect your rights, we need to make restrictions that forbid
1472 anyone to deny you these rights or to ask you to surrender the rights.
1473 These restrictions translate to certain responsibilities for you if you
1474 distribute copies of the software, or if you modify it.
1476 </P>
1478 For example, if you distribute copies of such a program, whether
1479 gratis or for a fee, you must give the recipients all the rights that
1480 you have. You must make sure that they, too, receive or can get the
1481 source code. And you must show them these terms so they know their
1482 rights.
1484 </P>
1486 We protect your rights with two steps: (1) copyright the software, and
1487 (2) offer you this license which gives you legal permission to copy,
1488 distribute and/or modify the software.
1490 </P>
1492 Also, for each author's protection and ours, we want to make certain
1493 that everyone understands that there is no warranty for this free
1494 software. If the software is modified by someone else and passed on, we
1495 want its recipients to know that what they have is not the original, so
1496 that any problems introduced by others will not reflect on the original
1497 authors' reputations.
1499 </P>
1501 Finally, any free program is threatened constantly by software
1502 patents. We wish to avoid the danger that redistributors of a free
1503 program will individually obtain patent licenses, in effect making the
1504 program proprietary. To prevent this, we have made it clear that any
1505 patent must be licensed for everyone's free use or not licensed at all.
1507 </P>
1509 The precise terms and conditions for copying, distribution and
1510 modification follow.
1512 </P>
1515 <H2><A NAME="SEC41" HREF="ahidev.html#TOC41">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A></H2>
1518 <OL>
1519 <LI>
1521 This License applies to any program or other work which contains
1522 a notice placed by the copyright holder saying it may be distributed
1523 under the terms of this General Public License. The "Program", below,
1524 refers to any such program or work, and a "work based on the Program"
1525 means either the Program or any derivative work under copyright law:
1526 that is to say, a work containing the Program or a portion of it,
1527 either verbatim or with modifications and/or translated into another
1528 language. (Hereinafter, translation is included without limitation in
1529 the term "modification".) Each licensee is addressed as "you".
1531 Activities other than copying, distribution and modification are not
1532 covered by this License; they are outside its scope. The act of
1533 running the Program is not restricted, and the output from the Program
1534 is covered only if its contents constitute a work based on the
1535 Program (independent of having been made by running the Program).
1536 Whether that is true depends on what the Program does.
1538 <LI>
1540 You may copy and distribute verbatim copies of the Program's
1541 source code as you receive it, in any medium, provided that you
1542 conspicuously and appropriately publish on each copy an appropriate
1543 copyright notice and disclaimer of warranty; keep intact all the
1544 notices that refer to this License and to the absence of any warranty;
1545 and give any other recipients of the Program a copy of this License
1546 along with the Program.
1548 You may charge a fee for the physical act of transferring a copy, and
1549 you may at your option offer warranty protection in exchange for a fee.
1551 <LI>
1553 You may modify your copy or copies of the Program or any portion
1554 of it, thus forming a work based on the Program, and copy and
1555 distribute such modifications or work under the terms of Section 1
1556 above, provided that you also meet all of these conditions:
1559 <OL>
1560 <LI>
1562 You must cause the modified files to carry prominent notices
1563 stating that you changed the files and the date of any change.
1565 <LI>
1567 You must cause any work that you distribute or publish, that in
1568 whole or in part contains or is derived from the Program or any
1569 part thereof, to be licensed as a whole at no charge to all third
1570 parties under the terms of this License.
1572 <LI>
1574 If the modified program normally reads commands interactively
1575 when run, you must cause it, when started running for such
1576 interactive use in the most ordinary way, to print or display an
1577 announcement including an appropriate copyright notice and a
1578 notice that there is no warranty (or else, saying that you provide
1579 a warranty) and that users may redistribute the program under
1580 these conditions, and telling the user how to view a copy of this
1581 License. (Exception: if the Program itself is interactive but
1582 does not normally print such an announcement, your work based on
1583 the Program is not required to print an announcement.)
1584 </OL>
1586 These requirements apply to the modified work as a whole. If
1587 identifiable sections of that work are not derived from the Program,
1588 and can be reasonably considered independent and separate works in
1589 themselves, then this License, and its terms, do not apply to those
1590 sections when you distribute them as separate works. But when you
1591 distribute the same sections as part of a whole which is a work based
1592 on the Program, the distribution of the whole must be on the terms of
1593 this License, whose permissions for other licensees extend to the
1594 entire whole, and thus to each and every part regardless of who wrote it.
1596 Thus, it is not the intent of this section to claim rights or contest
1597 your rights to work written entirely by you; rather, the intent is to
1598 exercise the right to control the distribution of derivative or
1599 collective works based on the Program.
1601 In addition, mere aggregation of another work not based on the Program
1602 with the Program (or with a work based on the Program) on a volume of
1603 a storage or distribution medium does not bring the other work under
1604 the scope of this License.
1606 <LI>
1608 You may copy and distribute the Program (or a work based on it,
1609 under Section 2) in object code or executable form under the terms of
1610 Sections 1 and 2 above provided that you also do one of the following:
1613 <OL>
1614 <LI>
1616 Accompany it with the complete corresponding machine-readable
1617 source code, which must be distributed under the terms of Sections
1618 1 and 2 above on a medium customarily used for software interchange; or,
1620 <LI>
1622 Accompany it with a written offer, valid for at least three
1623 years, to give any third party, for a charge no more than your
1624 cost of physically performing source distribution, a complete
1625 machine-readable copy of the corresponding source code, to be
1626 distributed under the terms of Sections 1 and 2 above on a medium
1627 customarily used for software interchange; or,
1629 <LI>
1631 Accompany it with the information you received as to the offer
1632 to distribute corresponding source code. (This alternative is
1633 allowed only for noncommercial distribution and only if you
1634 received the program in object code or executable form with such
1635 an offer, in accord with Subsection b above.)
1636 </OL>
1638 The source code for a work means the preferred form of the work for
1639 making modifications to it. For an executable work, complete source
1640 code means all the source code for all modules it contains, plus any
1641 associated interface definition files, plus the scripts used to
1642 control compilation and installation of the executable. However, as a
1643 special exception, the source code distributed need not include
1644 anything that is normally distributed (in either source or binary
1645 form) with the major components (compiler, kernel, and so on) of the
1646 operating system on which the executable runs, unless that component
1647 itself accompanies the executable.
1649 If distribution of executable or object code is made by offering
1650 access to copy from a designated place, then offering equivalent
1651 access to copy the source code from the same place counts as
1652 distribution of the source code, even though third parties are not
1653 compelled to copy the source along with the object code.
1655 <LI>
1657 You may not copy, modify, sublicense, or distribute the Program
1658 except as expressly provided under this License. Any attempt
1659 otherwise to copy, modify, sublicense or distribute the Program is
1660 void, and will automatically terminate your rights under this License.
1661 However, parties who have received copies, or rights, from you under
1662 this License will not have their licenses terminated so long as such
1663 parties remain in full compliance.
1665 <LI>
1667 You are not required to accept this License, since you have not
1668 signed it. However, nothing else grants you permission to modify or
1669 distribute the Program or its derivative works. These actions are
1670 prohibited by law if you do not accept this License. Therefore, by
1671 modifying or distributing the Program (or any work based on the
1672 Program), you indicate your acceptance of this License to do so, and
1673 all its terms and conditions for copying, distributing or modifying
1674 the Program or works based on it.
1676 <LI>
1678 Each time you redistribute the Program (or any work based on the
1679 Program), the recipient automatically receives a license from the
1680 original licensor to copy, distribute or modify the Program subject to
1681 these terms and conditions. You may not impose any further
1682 restrictions on the recipients' exercise of the rights granted herein.
1683 You are not responsible for enforcing compliance by third parties to
1684 this License.
1686 <LI>
1688 If, as a consequence of a court judgment or allegation of patent
1689 infringement or for any other reason (not limited to patent issues),
1690 conditions are imposed on you (whether by court order, agreement or
1691 otherwise) that contradict the conditions of this License, they do not
1692 excuse you from the conditions of this License. If you cannot
1693 distribute so as to satisfy simultaneously your obligations under this
1694 License and any other pertinent obligations, then as a consequence you
1695 may not distribute the Program at all. For example, if a patent
1696 license would not permit royalty-free redistribution of the Program by
1697 all those who receive copies directly or indirectly through you, then
1698 the only way you could satisfy both it and this License would be to
1699 refrain entirely from distribution of the Program.
1701 If any portion of this section is held invalid or unenforceable under
1702 any particular circumstance, the balance of the section is intended to
1703 apply and the section as a whole is intended to apply in other
1704 circumstances.
1706 It is not the purpose of this section to induce you to infringe any
1707 patents or other property right claims or to contest validity of any
1708 such claims; this section has the sole purpose of protecting the
1709 integrity of the free software distribution system, which is
1710 implemented by public license practices. Many people have made
1711 generous contributions to the wide range of software distributed
1712 through that system in reliance on consistent application of that
1713 system; it is up to the author/donor to decide if he or she is willing
1714 to distribute software through any other system and a licensee cannot
1715 impose that choice.
1717 This section is intended to make thoroughly clear what is believed to
1718 be a consequence of the rest of this License.
1720 <LI>
1722 If the distribution and/or use of the Program is restricted in
1723 certain countries either by patents or by copyrighted interfaces, the
1724 original copyright holder who places the Program under this License
1725 may add an explicit geographical distribution limitation excluding
1726 those countries, so that distribution is permitted only in or among
1727 countries not thus excluded. In such case, this License incorporates
1728 the limitation as if written in the body of this License.
1730 <LI>
1732 The Free Software Foundation may publish revised and/or new versions
1733 of the General Public License from time to time. Such new versions will
1734 be similar in spirit to the present version, but may differ in detail to
1735 address new problems or concerns.
1737 Each version is given a distinguishing version number. If the Program
1738 specifies a version number of this License which applies to it and "any
1739 later version", you have the option of following the terms and conditions
1740 either of that version or of any later version published by the Free
1741 Software Foundation. If the Program does not specify a version number of
1742 this License, you may choose any version ever published by the Free Software
1743 Foundation.
1745 <LI>
1747 If you wish to incorporate parts of the Program into other free
1748 programs whose distribution conditions are different, write to the author
1749 to ask for permission. For software which is copyrighted by the Free
1750 Software Foundation, write to the Free Software Foundation; we sometimes
1751 make exceptions for this. Our decision will be guided by the two goals
1752 of preserving the free status of all derivatives of our free software and
1753 of promoting the sharing and reuse of software generally.
1757 <P><STRONG>NO WARRANTY</STRONG></P>
1759 <LI>
1761 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
1762 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
1763 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
1764 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
1765 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
1766 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
1767 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
1768 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
1769 REPAIR OR CORRECTION.
1771 <LI>
1773 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
1774 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
1775 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
1776 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
1777 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
1778 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
1779 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
1780 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
1781 POSSIBILITY OF SUCH DAMAGES.
1782 </OL>
1785 <H2>END OF TERMS AND CONDITIONS</H2>
1789 <H2><A NAME="SEC42" HREF="ahidev.html#TOC42">How to Apply These Terms to Your New Programs</A></H2>
1792 If you develop a new program, and you want it to be of the greatest
1793 possible use to the public, the best way to achieve this is to make it
1794 free software which everyone can redistribute and change under these terms.
1796 </P>
1798 To do so, attach the following notices to the program. It is safest
1799 to attach them to the start of each source file to most effectively
1800 convey the exclusion of warranty; and each file should have at least
1801 the "copyright" line and a pointer to where the full notice is found.
1803 </P>
1805 <PRE>
1806 <VAR>one line to give the program's name and an idea of what it does.</VAR>
1807 Copyright (C) 19<VAR>yy</VAR> <VAR>name of author</VAR>
1809 This program is free software; you can redistribute it and/or
1810 modify it under the terms of the GNU General Public License
1811 as published by the Free Software Foundation; either version 2
1812 of the License, or (at your option) any later version.
1814 This program is distributed in the hope that it will be useful,
1815 but WITHOUT ANY WARRANTY; without even the implied warranty of
1816 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1817 GNU General Public License for more details.
1819 You should have received a copy of the GNU General Public License along
1820 with this program; if not, write to the Free Software Foundation, Inc.,
1821 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
1822 </PRE>
1825 Also add information on how to contact you by electronic and paper mail.
1827 </P>
1829 If the program is interactive, make it output a short notice like this
1830 when it starts in an interactive mode:
1832 </P>
1834 <PRE>
1835 Gnomovision version 69, Copyright (C) 19<VAR>yy</VAR> <VAR>name of author</VAR>
1836 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
1837 type `show w'. This is free software, and you are welcome
1838 to redistribute it under certain conditions; type `show c'
1839 for details.
1840 </PRE>
1843 The hypothetical commands <SAMP>`show w'</SAMP> and <SAMP>`show c'</SAMP> should show
1844 the appropriate parts of the General Public License. Of course, the
1845 commands you use may be called something other than <SAMP>`show w'</SAMP> and
1846 <SAMP>`show c'</SAMP>; they could even be mouse-clicks or menu items--whatever
1847 suits your program.
1849 </P>
1851 You should also get your employer (if you work as a programmer) or your
1852 school, if any, to sign a "copyright disclaimer" for the program, if
1853 necessary. Here is a sample; alter the names:
1855 </P>
1857 <PRE>
1858 Yoyodyne, Inc., hereby disclaims all copyright
1859 interest in the program `Gnomovision'
1860 (which makes passes at compilers) written
1861 by James Hacker.
1863 <VAR>signature of Ty Coon</VAR>, 1 April 1989
1864 Ty Coon, President of Vice
1865 </PRE>
1868 This General Public License does not permit incorporating your program into
1869 proprietary programs. If your program is a subroutine library, you may
1870 consider it more useful to permit linking proprietary applications with the
1871 library. If this is what you want to do, use the GNU Library General
1872 Public License instead of this License.
1874 </P>
1878 <H1><A NAME="SEC43" HREF="ahidev.html#TOC43">GNU LIBRARY GENERAL PUBLIC LICENSE</A></H1>
1881 Version 2, June 1991
1883 </P>
1885 <PRE>
1886 Copyright (C) 1991 Free Software Foundation, Inc.
1887 675 Mass Ave, Cambridge, MA 02139, USA
1888 Everyone is permitted to copy and distribute verbatim copies
1889 of this license document, but changing it is not allowed.
1891 [This is the first released version of the library GPL. It is
1892 numbered 2 because it goes with version 2 of the ordinary GPL.]
1893 </PRE>
1897 <H2><A NAME="SEC44" HREF="ahidev.html#TOC44">Preamble</A></H2>
1900 The licenses for most software are designed to take away your
1901 freedom to share and change it. By contrast, the GNU General Public
1902 Licenses are intended to guarantee your freedom to share and change
1903 free software--to make sure the software is free for all its users.
1905 </P>
1907 This license, the Library General Public License, applies to some
1908 specially designated Free Software Foundation software, and to any
1909 other libraries whose authors decide to use it. You can use it for
1910 your libraries, too.
1912 </P>
1914 When we speak of free software, we are referring to freedom, not
1915 price. Our General Public Licenses are designed to make sure that you
1916 have the freedom to distribute copies of free software (and charge for
1917 this service if you wish), that you receive source code or can get it
1918 if you want it, that you can change the software or use pieces of it
1919 in new free programs; and that you know you can do these things.
1921 </P>
1923 To protect your rights, we need to make restrictions that forbid
1924 anyone to deny you these rights or to ask you to surrender the rights.
1925 These restrictions translate to certain responsibilities for you if
1926 you distribute copies of the library, or if you modify it.
1928 </P>
1930 For example, if you distribute copies of the library, whether gratis
1931 or for a fee, you must give the recipients all the rights that we gave
1932 you. You must make sure that they, too, receive or can get the source
1933 code. If you link a program with the library, you must provide
1934 complete object files to the recipients so that they can relink them
1935 with the library, after making changes to the library and recompiling
1936 it. And you must show them these terms so they know their rights.
1938 </P>
1940 Our method of protecting your rights has two steps: (1) copyright
1941 the library, and (2) offer you this license which gives you legal
1942 permission to copy, distribute and/or modify the library.
1944 </P>
1946 Also, for each distributor's protection, we want to make certain
1947 that everyone understands that there is no warranty for this free
1948 library. If the library is modified by someone else and passed on, we
1949 want its recipients to know that what they have is not the original
1950 version, so that any problems introduced by others will not reflect on
1951 the original authors' reputations.
1953 </P>
1955 Finally, any free program is threatened constantly by software
1956 patents. We wish to avoid the danger that companies distributing free
1957 software will individually obtain patent licenses, thus in effect
1958 transforming the program into proprietary software. To prevent this,
1959 we have made it clear that any patent must be licensed for everyone's
1960 free use or not licensed at all.
1962 </P>
1964 Most GNU software, including some libraries, is covered by the ordinary
1965 GNU General Public License, which was designed for utility programs. This
1966 license, the GNU Library General Public License, applies to certain
1967 designated libraries. This license is quite different from the ordinary
1968 one; be sure to read it in full, and don't assume that anything in it is
1969 the same as in the ordinary license.
1971 </P>
1973 The reason we have a separate public license for some libraries is that
1974 they blur the distinction we usually make between modifying or adding to a
1975 program and simply using it. Linking a program with a library, without
1976 changing the library, is in some sense simply using the library, and is
1977 analogous to running a utility program or application program. However, in
1978 a textual and legal sense, the linked executable is a combined work, a
1979 derivative of the original library, and the ordinary General Public License
1980 treats it as such.
1982 </P>
1984 Because of this blurred distinction, using the ordinary General
1985 Public License for libraries did not effectively promote software
1986 sharing, because most developers did not use the libraries. We
1987 concluded that weaker conditions might promote sharing better.
1989 </P>
1991 However, unrestricted linking of non-free programs would deprive the
1992 users of those programs of all benefit from the free status of the
1993 libraries themselves. This Library General Public License is intended to
1994 permit developers of non-free programs to use free libraries, while
1995 preserving your freedom as a user of such programs to change the free
1996 libraries that are incorporated in them. (We have not seen how to achieve
1997 this as regards changes in header files, but we have achieved it as regards
1998 changes in the actual functions of the Library.) The hope is that this
1999 will lead to faster development of free libraries.
2001 </P>
2003 The precise terms and conditions for copying, distribution and
2004 modification follow. Pay close attention to the difference between a
2005 "work based on the library" and a "work that uses the library". The
2006 former contains code derived from the library, while the latter only
2007 works together with the library.
2009 </P>
2011 Note that it is possible for a library to be covered by the ordinary
2012 General Public License rather than by this special one.
2014 </P>
2017 <H2><A NAME="SEC45" HREF="ahidev.html#TOC45">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</A></H2>
2020 <OL>
2021 <LI>
2023 This License Agreement applies to any software library which
2024 contains a notice placed by the copyright holder or other authorized
2025 party saying it may be distributed under the terms of this Library
2026 General Public License (also called "this License"). Each licensee is
2027 addressed as "you".
2029 A "library" means a collection of software functions and/or data
2030 prepared so as to be conveniently linked with application programs
2031 (which use some of those functions and data) to form executables.
2033 The "Library", below, refers to any such software library or work
2034 which has been distributed under these terms. A "work based on the
2035 Library" means either the Library or any derivative work under
2036 copyright law: that is to say, a work containing the Library or a
2037 portion of it, either verbatim or with modifications and/or translated
2038 straightforwardly into another language. (Hereinafter, translation is
2039 included without limitation in the term "modification".)
2041 "Source code" for a work means the preferred form of the work for
2042 making modifications to it. For a library, complete source code means
2043 all the source code for all modules it contains, plus any associated
2044 interface definition files, plus the scripts used to control compilation
2045 and installation of the library.
2047 Activities other than copying, distribution and modification are not
2048 covered by this License; they are outside its scope. The act of
2049 running a program using the Library is not restricted, and output from
2050 such a program is covered only if its contents constitute a work based
2051 on the Library (independent of the use of the Library in a tool for
2052 writing it). Whether that is true depends on what the Library does
2053 and what the program that uses the Library does.
2055 <LI>
2057 You may copy and distribute verbatim copies of the Library's
2058 complete source code as you receive it, in any medium, provided that
2059 you conspicuously and appropriately publish on each copy an
2060 appropriate copyright notice and disclaimer of warranty; keep intact
2061 all the notices that refer to this License and to the absence of any
2062 warranty; and distribute a copy of this License along with the
2063 Library.
2065 You may charge a fee for the physical act of transferring a copy,
2066 and you may at your option offer warranty protection in exchange for a
2067 fee.
2069 <LI>
2071 You may modify your copy or copies of the Library or any portion
2072 of it, thus forming a work based on the Library, and copy and
2073 distribute such modifications or work under the terms of Section 1
2074 above, provided that you also meet all of these conditions:
2077 <OL>
2078 <LI>
2080 The modified work must itself be a software library.
2082 <LI>
2084 You must cause the files modified to carry prominent notices
2085 stating that you changed the files and the date of any change.
2087 <LI>
2089 You must cause the whole of the work to be licensed at no
2090 charge to all third parties under the terms of this License.
2092 <LI>
2094 If a facility in the modified Library refers to a function or a
2095 table of data to be supplied by an application program that uses
2096 the facility, other than as an argument passed when the facility
2097 is invoked, then you must make a good faith effort to ensure that,
2098 in the event an application does not supply such function or
2099 table, the facility still operates, and performs whatever part of
2100 its purpose remains meaningful.
2102 (For example, a function in a library to compute square roots has
2103 a purpose that is entirely well-defined independent of the
2104 application. Therefore, Subsection 2d requires that any
2105 application-supplied function or table used by this function must
2106 be optional: if the application does not supply it, the square
2107 root function must still compute square roots.)
2108 </OL>
2110 These requirements apply to the modified work as a whole. If
2111 identifiable sections of that work are not derived from the Library,
2112 and can be reasonably considered independent and separate works in
2113 themselves, then this License, and its terms, do not apply to those
2114 sections when you distribute them as separate works. But when you
2115 distribute the same sections as part of a whole which is a work based
2116 on the Library, the distribution of the whole must be on the terms of
2117 this License, whose permissions for other licensees extend to the
2118 entire whole, and thus to each and every part regardless of who wrote
2121 Thus, it is not the intent of this section to claim rights or contest
2122 your rights to work written entirely by you; rather, the intent is to
2123 exercise the right to control the distribution of derivative or
2124 collective works based on the Library.
2126 In addition, mere aggregation of another work not based on the Library
2127 with the Library (or with a work based on the Library) on a volume of
2128 a storage or distribution medium does not bring the other work under
2129 the scope of this License.
2131 <LI>
2133 You may opt to apply the terms of the ordinary GNU General Public
2134 License instead of this License to a given copy of the Library. To do
2135 this, you must alter all the notices that refer to this License, so
2136 that they refer to the ordinary GNU General Public License, version 2,
2137 instead of to this License. (If a newer version than version 2 of the
2138 ordinary GNU General Public License has appeared, then you can specify
2139 that version instead if you wish.) Do not make any other change in
2140 these notices.
2142 Once this change is made in a given copy, it is irreversible for
2143 that copy, so the ordinary GNU General Public License applies to all
2144 subsequent copies and derivative works made from that copy.
2146 This option is useful when you wish to copy part of the code of
2147 the Library into a program that is not a library.
2149 <LI>
2151 You may copy and distribute the Library (or a portion or
2152 derivative of it, under Section 2) in object code or executable form
2153 under the terms of Sections 1 and 2 above provided that you accompany
2154 it with the complete corresponding machine-readable source code, which
2155 must be distributed under the terms of Sections 1 and 2 above on a
2156 medium customarily used for software interchange.
2158 If distribution of object code is made by offering access to copy
2159 from a designated place, then offering equivalent access to copy the
2160 source code from the same place satisfies the requirement to
2161 distribute the source code, even though third parties are not
2162 compelled to copy the source along with the object code.
2164 <LI>
2166 A program that contains no derivative of any portion of the
2167 Library, but is designed to work with the Library by being compiled or
2168 linked with it, is called a "work that uses the Library". Such a
2169 work, in isolation, is not a derivative work of the Library, and
2170 therefore falls outside the scope of this License.
2172 However, linking a "work that uses the Library" with the Library
2173 creates an executable that is a derivative of the Library (because it
2174 contains portions of the Library), rather than a "work that uses the
2175 library". The executable is therefore covered by this License.
2176 Section 6 states terms for distribution of such executables.
2178 When a "work that uses the Library" uses material from a header file
2179 that is part of the Library, the object code for the work may be a
2180 derivative work of the Library even though the source code is not.
2181 Whether this is true is especially significant if the work can be
2182 linked without the Library, or if the work is itself a library. The
2183 threshold for this to be true is not precisely defined by law.
2185 If such an object file uses only numerical parameters, data
2186 structure layouts and accessors, and small macros and small inline
2187 functions (ten lines or less in length), then the use of the object
2188 file is unrestricted, regardless of whether it is legally a derivative
2189 work. (Executables containing this object code plus portions of the
2190 Library will still fall under Section 6.)
2192 Otherwise, if the work is a derivative of the Library, you may
2193 distribute the object code for the work under the terms of Section 6.
2194 Any executables containing that work also fall under Section 6,
2195 whether or not they are linked directly with the Library itself.
2197 <LI>
2199 As an exception to the Sections above, you may also compile or
2200 link a "work that uses the Library" with the Library to produce a
2201 work containing portions of the Library, and distribute that work
2202 under terms of your choice, provided that the terms permit
2203 modification of the work for the customer's own use and reverse
2204 engineering for debugging such modifications.
2206 You must give prominent notice with each copy of the work that the
2207 Library is used in it and that the Library and its use are covered by
2208 this License. You must supply a copy of this License. If the work
2209 during execution displays copyright notices, you must include the
2210 copyright notice for the Library among them, as well as a reference
2211 directing the user to the copy of this License. Also, you must do one
2212 of these things:
2215 <OL>
2216 <LI>
2218 Accompany the work with the complete corresponding
2219 machine-readable source code for the Library including whatever
2220 changes were used in the work (which must be distributed under
2221 Sections 1 and 2 above); and, if the work is an executable linked
2222 with the Library, with the complete machine-readable "work that
2223 uses the Library", as object code and/or source code, so that the
2224 user can modify the Library and then relink to produce a modified
2225 executable containing the modified Library. (It is understood
2226 that the user who changes the contents of definitions files in the
2227 Library will not necessarily be able to recompile the application
2228 to use the modified definitions.)
2230 <LI>
2232 Accompany the work with a written offer, valid for at
2233 least three years, to give the same user the materials
2234 specified in Subsection 6a, above, for a charge no more
2235 than the cost of performing this distribution.
2237 <LI>
2239 If distribution of the work is made by offering access to copy
2240 from a designated place, offer equivalent access to copy the above
2241 specified materials from the same place.
2243 <LI>
2245 Verify that the user has already received a copy of these
2246 materials or that you have already sent this user a copy.
2247 </OL>
2249 For an executable, the required form of the "work that uses the
2250 Library" must include any data and utility programs needed for
2251 reproducing the executable from it. However, as a special exception,
2252 the source code distributed need not include anything that is normally
2253 distributed (in either source or binary form) with the major
2254 components (compiler, kernel, and so on) of the operating system on
2255 which the executable runs, unless that component itself accompanies
2256 the executable.
2258 It may happen that this requirement contradicts the license
2259 restrictions of other proprietary libraries that do not normally
2260 accompany the operating system. Such a contradiction means you cannot
2261 use both them and the Library together in an executable that you
2262 distribute.
2264 <LI>
2266 You may place library facilities that are a work based on the
2267 Library side-by-side in a single library together with other library
2268 facilities not covered by this License, and distribute such a combined
2269 library, provided that the separate distribution of the work based on
2270 the Library and of the other library facilities is otherwise
2271 permitted, and provided that you do these two things:
2274 <OL>
2275 <LI>
2277 Accompany the combined library with a copy of the same work
2278 based on the Library, uncombined with any other library
2279 facilities. This must be distributed under the terms of the
2280 Sections above.
2282 <LI>
2284 Give prominent notice with the combined library of the fact
2285 that part of it is a work based on the Library, and explaining
2286 where to find the accompanying uncombined form of the same work.
2287 </OL>
2289 <LI>
2291 You may not copy, modify, sublicense, link with, or distribute
2292 the Library except as expressly provided under this License. Any
2293 attempt otherwise to copy, modify, sublicense, link with, or
2294 distribute the Library is void, and will automatically terminate your
2295 rights under this License. However, parties who have received copies,
2296 or rights, from you under this License will not have their licenses
2297 terminated so long as such parties remain in full compliance.
2299 <LI>
2301 You are not required to accept this License, since you have not
2302 signed it. However, nothing else grants you permission to modify or
2303 distribute the Library or its derivative works. These actions are
2304 prohibited by law if you do not accept this License. Therefore, by
2305 modifying or distributing the Library (or any work based on the
2306 Library), you indicate your acceptance of this License to do so, and
2307 all its terms and conditions for copying, distributing or modifying
2308 the Library or works based on it.
2310 <LI>
2312 Each time you redistribute the Library (or any work based on the
2313 Library), the recipient automatically receives a license from the
2314 original licensor to copy, distribute, link with or modify the Library
2315 subject to these terms and conditions. You may not impose any further
2316 restrictions on the recipients' exercise of the rights granted herein.
2317 You are not responsible for enforcing compliance by third parties to
2318 this License.
2320 <LI>
2322 If, as a consequence of a court judgment or allegation of patent
2323 infringement or for any other reason (not limited to patent issues),
2324 conditions are imposed on you (whether by court order, agreement or
2325 otherwise) that contradict the conditions of this License, they do not
2326 excuse you from the conditions of this License. If you cannot
2327 distribute so as to satisfy simultaneously your obligations under this
2328 License and any other pertinent obligations, then as a consequence you
2329 may not distribute the Library at all. For example, if a patent
2330 license would not permit royalty-free redistribution of the Library by
2331 all those who receive copies directly or indirectly through you, then
2332 the only way you could satisfy both it and this License would be to
2333 refrain entirely from distribution of the Library.
2335 If any portion of this section is held invalid or unenforceable under any
2336 particular circumstance, the balance of the section is intended to apply,
2337 and the section as a whole is intended to apply in other circumstances.
2339 It is not the purpose of this section to induce you to infringe any
2340 patents or other property right claims or to contest validity of any
2341 such claims; this section has the sole purpose of protecting the
2342 integrity of the free software distribution system which is
2343 implemented by public license practices. Many people have made
2344 generous contributions to the wide range of software distributed
2345 through that system in reliance on consistent application of that
2346 system; it is up to the author/donor to decide if he or she is willing
2347 to distribute software through any other system and a licensee cannot
2348 impose that choice.
2350 This section is intended to make thoroughly clear what is believed to
2351 be a consequence of the rest of this License.
2353 <LI>
2355 If the distribution and/or use of the Library is restricted in
2356 certain countries either by patents or by copyrighted interfaces, the
2357 original copyright holder who places the Library under this License may add
2358 an explicit geographical distribution limitation excluding those countries,
2359 so that distribution is permitted only in or among countries not thus
2360 excluded. In such case, this License incorporates the limitation as if
2361 written in the body of this License.
2363 <LI>
2365 The Free Software Foundation may publish revised and/or new
2366 versions of the Library General Public License from time to time.
2367 Such new versions will be similar in spirit to the present version,
2368 but may differ in detail to address new problems or concerns.
2370 Each version is given a distinguishing version number. If the Library
2371 specifies a version number of this License which applies to it and
2372 "any later version", you have the option of following the terms and
2373 conditions either of that version or of any later version published by
2374 the Free Software Foundation. If the Library does not specify a
2375 license version number, you may choose any version ever published by
2376 the Free Software Foundation.
2378 <LI>
2380 If you wish to incorporate parts of the Library into other free
2381 programs whose distribution conditions are incompatible with these,
2382 write to the author to ask for permission. For software which is
2383 copyrighted by the Free Software Foundation, write to the Free
2384 Software Foundation; we sometimes make exceptions for this. Our
2385 decision will be guided by the two goals of preserving the free status
2386 of all derivatives of our free software and of promoting the sharing
2387 and reuse of software generally.
2391 <P><STRONG>NO WARRANTY</STRONG></P>
2393 <LI>
2395 BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
2396 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
2397 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
2398 OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
2399 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
2400 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2401 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
2402 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
2403 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
2405 <LI>
2407 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
2408 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
2409 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
2410 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
2411 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
2412 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
2413 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
2414 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
2415 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
2416 DAMAGES.
2417 </OL>
2420 <H2>END OF TERMS AND CONDITIONS</H2>
2424 <H2><A NAME="SEC46" HREF="ahidev.html#TOC46">How to Apply These Terms to Your New Libraries</A></H2>
2427 If you develop a new library, and you want it to be of the greatest
2428 possible use to the public, we recommend making it free software that
2429 everyone can redistribute and change. You can do so by permitting
2430 redistribution under these terms (or, alternatively, under the terms of the
2431 ordinary General Public License).
2433 </P>
2435 To apply these terms, attach the following notices to the library. It is
2436 safest to attach them to the start of each source file to most effectively
2437 convey the exclusion of warranty; and each file should have at least the
2438 "copyright" line and a pointer to where the full notice is found.
2440 </P>
2442 <PRE>
2443 <VAR>one line to give the library's name and an idea of what it does.</VAR>
2444 Copyright (C) <VAR>year</VAR> <VAR>name of author</VAR>
2446 This library is free software; you can redistribute it and/or modify it
2447 under the terms of the GNU Library General Public License as published
2448 by the Free Software Foundation; either version 2 of the License, or (at
2449 your option) any later version.
2451 This library is distributed in the hope that it will be useful, but
2452 WITHOUT ANY WARRANTY; without even the implied warranty of
2453 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2454 Library General Public License for more details.
2456 You should have received a copy of the GNU Library General Public
2457 License along with this library; if not, write to the Free Software
2458 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2459 </PRE>
2462 Also add information on how to contact you by electronic and paper mail.
2464 </P>
2466 You should also get your employer (if you work as a programmer) or your
2467 school, if any, to sign a "copyright disclaimer" for the library, if
2468 necessary. Here is a sample; alter the names:
2470 </P>
2472 <PRE>
2473 Yoyodyne, Inc., hereby disclaims all copyright interest in the library
2474 `Frob' (a library for tweaking knobs) written by James Random Hacker.
2476 <VAR>signature of Ty Coon</VAR>, 1 April 1990
2477 Ty Coon, President of Vice
2478 </PRE>
2481 That's all there is to it!
2483 </P>
2487 <H1><A NAME="SEC47" HREF="ahidev.html#TOC47">Concept Index</A></H1>
2490 <A NAME="IDX111"></A>
2492 </P>
2494 <H2>a</H2>
2495 <DIR>
2496 <LI><A HREF="ahidev.html#IDX71">Audio streams, playing</A>
2497 <LI><A HREF="ahidev.html#IDX9">Author of AHI</A>
2498 </DIR>
2499 <H2>c</H2>
2500 <DIR>
2501 <LI><A HREF="ahidev.html#IDX7">Copyright</A>
2502 </DIR>
2503 <H2>d</H2>
2504 <DIR>
2505 <LI><A HREF="ahidev.html#IDX105">Data Types</A>
2506 <LI><A HREF="ahidev.html#IDX104">Data Types And Structures</A>
2507 <LI><A HREF="ahidev.html#IDX10">Definitions</A>
2508 <LI><A HREF="ahidev.html#IDX3">Disclaimer</A>
2509 <LI><A HREF="ahidev.html#IDX102">Distortion, playing</A>
2510 <LI><A HREF="ahidev.html#IDX87">Distortion, recording</A>
2511 <LI><A HREF="ahidev.html#IDX2">Distribution</A>
2512 <LI><A HREF="ahidev.html#IDX86">Double Buffering, reading</A>
2513 <LI><A HREF="ahidev.html#IDX101">Double Buffering, writing</A>
2514 </DIR>
2515 <H2>f</H2>
2516 <DIR>
2517 <LI><A HREF="ahidev.html#IDX14">Function Interface</A>
2518 </DIR>
2519 <H2>g</H2>
2520 <DIR>
2521 <LI><A HREF="ahidev.html#IDX17">Games, music</A>
2522 <LI><A HREF="ahidev.html#IDX18">Games, sound effects</A>
2523 <LI><A HREF="ahidev.html#IDX21">Guidelines</A>
2524 </DIR>
2525 <H2>h</H2>
2526 <DIR>
2527 <LI><A HREF="ahidev.html#IDX29">Hooks</A>
2528 </DIR>
2529 <H2>l</H2>
2530 <DIR>
2531 <LI><A HREF="ahidev.html#IDX5">Legal nonsense</A>
2532 <LI><A HREF="ahidev.html#IDX23">Library base</A>
2533 <LI><A HREF="ahidev.html#IDX4">License</A>
2534 <LI><A HREF="ahidev.html#IDX51">Loading Sounds</A>
2535 </DIR>
2536 <H2>m</H2>
2537 <DIR>
2538 <LI><A HREF="ahidev.html#IDX30">Multitasking</A>
2539 <LI><A HREF="ahidev.html#IDX15">Music, games</A>
2540 <LI><A HREF="ahidev.html#IDX69">Music, streams from disk</A>
2541 </DIR>
2542 <H2>o</H2>
2543 <DIR>
2544 <LI><A HREF="ahidev.html#IDX1">Overview</A>
2545 </DIR>
2546 <H2>p</H2>
2547 <DIR>
2548 <LI><A HREF="ahidev.html#IDX89">Playing</A>
2549 <LI><A HREF="ahidev.html#IDX70">Playing audio streams</A>
2550 <LI><A HREF="ahidev.html#IDX103">Precedences</A>
2551 <LI><A HREF="ahidev.html#IDX22">Programming guidelines</A>
2552 </DIR>
2553 <H2>r</H2>
2554 <DIR>
2555 <LI><A HREF="ahidev.html#IDX76">Reading</A>
2556 <LI><A HREF="ahidev.html#IDX19">Realtime effects</A>
2557 <LI><A HREF="ahidev.html#IDX77">Recording</A>
2558 <LI><A HREF="ahidev.html#IDX20">Recording, high quality</A>
2559 <LI><A HREF="ahidev.html#IDX73">Recording, quick and easy</A>
2560 <LI><A HREF="ahidev.html#IDX111">Recursion</A>
2561 </DIR>
2562 <H2>s</H2>
2563 <DIR>
2564 <LI><A HREF="ahidev.html#IDX11">Sample</A>
2565 <LI><A HREF="ahidev.html#IDX12">Sample frame</A>
2566 <LI><A HREF="ahidev.html#IDX6">Software license</A>
2567 <LI><A HREF="ahidev.html#IDX13">Sound</A>
2568 <LI><A HREF="ahidev.html#IDX16">Sound effects, games</A>
2569 <LI><A HREF="ahidev.html#IDX72">Sound effects, system</A>
2570 <LI><A HREF="ahidev.html#IDX108">Structures</A>
2571 <LI><A HREF="ahidev.html#IDX68">Surround sound</A>
2572 </DIR>
2573 <H2>t</H2>
2574 <DIR>
2575 <LI><A HREF="ahidev.html#IDX25">The Audio Database</A>
2576 <LI><A HREF="ahidev.html#IDX8">The Author</A>
2577 </DIR>
2578 <H2>u</H2>
2579 <DIR>
2580 <LI><A HREF="ahidev.html#IDX52">Unloading Sounds</A>
2581 </DIR>
2582 <H2>w</H2>
2583 <DIR>
2584 <LI><A HREF="ahidev.html#IDX88">Writing</A>
2585 </DIR>
2587 </P>
2591 <H1><A NAME="SEC48" HREF="ahidev.html#TOC48">Data Type Index</A></H1>
2594 <H2>a</H2>
2595 <DIR>
2596 <LI><A HREF="ahidev.html#IDX32">AHIAudioCtrl</A>
2597 <LI><A HREF="ahidev.html#IDX24">AHIBase</A>
2598 <LI><A HREF="ahidev.html#IDX110">AHIGlobalPrefs</A>
2599 <LI><A HREF="ahidev.html#IDX74">AHIRequest</A>
2600 <LI><A HREF="ahidev.html#IDX41">AHISoundMessage</A>
2601 <LI><A HREF="ahidev.html#IDX109">AHIUnitPrefs</A>
2602 </DIR>
2603 <H2>f</H2>
2604 <DIR>
2605 <LI><A HREF="ahidev.html#IDX106">Fixed</A>
2606 </DIR>
2607 <H2>s</H2>
2608 <DIR>
2609 <LI><A HREF="ahidev.html#IDX107">sposition</A>
2610 </DIR>
2612 </P>
2616 <H1><A NAME="SEC49" HREF="ahidev.html#TOC49">Function Index</A></H1>
2619 <H2>a</H2>
2620 <DIR>
2621 <LI><A HREF="ahidev.html#IDX31">AHI_AllocAudioA()</A>
2622 <LI><A HREF="ahidev.html#IDX28">AHI_BestAudioIDA()</A>
2623 <LI><A HREF="ahidev.html#IDX61">AHI_ControlAudioA()</A>
2624 <LI><A HREF="ahidev.html#IDX34">AHI_FreeAudio()</A>
2625 <LI><A HREF="ahidev.html#IDX27">AHI_GetAudioAttrsA()</A>
2626 <LI><A HREF="ahidev.html#IDX53">AHI_LoadSound()</A>
2627 <LI><A HREF="ahidev.html#IDX26">AHI_NextAudioID()</A>
2628 <LI><A HREF="ahidev.html#IDX66">AHI_PlayA()</A>
2629 <LI><A HREF="ahidev.html#IDX64">AHI_SetFreq()</A>
2630 <LI><A HREF="ahidev.html#IDX63">AHI_SetSound()</A>
2631 <LI><A HREF="ahidev.html#IDX65">AHI_SetVol()</A>
2632 <LI><A HREF="ahidev.html#IDX60">AHI_UnloadSound()</A>
2633 </DIR>
2635 </P>
2639 <H1><A NAME="SEC50" HREF="ahidev.html#TOC50">Variable Index</A></H1>
2642 <H2>a</H2>
2643 <DIR>
2644 <LI><A HREF="ahidev.html#IDX37">AHI_DEFAULT_FREQ</A>
2645 <LI><A HREF="ahidev.html#IDX35">AHI_DEFAULT_ID</A>
2646 <LI><A HREF="ahidev.html#IDX75">AHI_DEFAULT_UNIT</A>
2647 <LI><A HREF="ahidev.html#IDX36">AHIA_AudioID</A>
2648 <LI><A HREF="ahidev.html#IDX39">AHIA_Channels</A>
2649 <LI><A HREF="ahidev.html#IDX47">AHIA_MaxPlayerFreq</A>
2650 <LI><A HREF="ahidev.html#IDX46">AHIA_MinPlayerFreq</A>
2651 <LI><A HREF="ahidev.html#IDX38">AHIA_MixFreq</A>
2652 <LI><A HREF="ahidev.html#IDX45">AHIA_PlayerFreq</A>
2653 <LI><A HREF="ahidev.html#IDX44">AHIA_PlayerFunc</A>
2654 <LI><A HREF="ahidev.html#IDX48">AHIA_RecordFunc</A>
2655 <LI><A HREF="ahidev.html#IDX43">AHIA_SoundFunc</A>
2656 <LI><A HREF="ahidev.html#IDX40">AHIA_Sounds</A>
2657 <LI><A HREF="ahidev.html#IDX50">AHIA_UserData</A>
2658 <LI><A HREF="ahidev.html#IDX33">ahiac_UserData</A>, <A HREF="ahidev.html#IDX49">ahiac_UserData</A>
2659 <LI><A HREF="ahidev.html#IDX62">AHIC_Play</A>
2660 <LI><A HREF="ahidev.html#IDX83">ahir_Frequency</A>, <A HREF="ahidev.html#IDX96">ahir_Frequency</A>
2661 <LI><A HREF="ahidev.html#IDX99">ahir_Link</A>
2662 <LI><A HREF="ahidev.html#IDX98">ahir_Position</A>
2663 <LI><A HREF="ahidev.html#IDX82">ahir_Type</A>, <A HREF="ahidev.html#IDX95">ahir_Type</A>
2664 <LI><A HREF="ahidev.html#IDX97">ahir_Volume</A>
2665 <LI><A HREF="ahidev.html#IDX67">AHISF_IMM</A>
2666 <LI><A HREF="ahidev.html#IDX42">ahism_Channel</A>
2667 <LI><A HREF="ahidev.html#IDX55">AHIST_DYNAMICSAMPLE</A>
2668 <LI><A HREF="ahidev.html#IDX58">AHIST_M16S</A>
2669 <LI><A HREF="ahidev.html#IDX56">AHIST_M8S</A>
2670 <LI><A HREF="ahidev.html#IDX59">AHIST_S16S</A>
2671 <LI><A HREF="ahidev.html#IDX57">AHIST_S8S</A>
2672 <LI><A HREF="ahidev.html#IDX54">AHIST_SAMPLE</A>
2673 </DIR>
2674 <H2>c</H2>
2675 <DIR>
2676 <LI><A HREF="ahidev.html#IDX78">CMD_READ</A>
2677 <LI><A HREF="ahidev.html#IDX90">CMD_WRITE</A>
2678 </DIR>
2679 <H2>i</H2>
2680 <DIR>
2681 <LI><A HREF="ahidev.html#IDX79">io_Command</A>, <A HREF="ahidev.html#IDX91">io_Command</A>
2682 <LI><A HREF="ahidev.html#IDX81">io_Data</A>, <A HREF="ahidev.html#IDX94">io_Data</A>
2683 <LI><A HREF="ahidev.html#IDX80">io_Length</A>, <A HREF="ahidev.html#IDX84">io_Length</A>, <A HREF="ahidev.html#IDX93">io_Length</A>, <A HREF="ahidev.html#IDX100">io_Length</A>
2684 <LI><A HREF="ahidev.html#IDX85">io_Offset</A>
2685 </DIR>
2686 <H2>l</H2>
2687 <DIR>
2688 <LI><A HREF="ahidev.html#IDX92">ln_Pri</A>
2689 </DIR>
2691 </P>
2693 <P><HR><P>
2694 <H1>Footnotes</H1>
2695 <H3><A NAME="FOOT1" HREF="ahidev.html#DOCF1">(1)</A></H3>
2696 <P>Available from AmiNet, for example <BR>
2697 @url{ftp://ftp.germany.aminet.org/pub/aminet/dev/debug/Sushi.lha
2698 <P><HR><P>
2699 This document was generated on 27 December 2000 using the
2700 <A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
2701 translator version 1.51.</P>
2702 </BODY>
2703 </HTML>