SB AWE32 Developer's Information Pack
PART V 3D Positional Audio API
••
105
Copyright
Creative Technology Ltd., 1994-1996
Version 3.00
Specify the new coordinates of the receiver.
Return
Return
c3daSUCCESS
upon success and
c3daFAILURE
otherwise.
Remarks
If
lpRx
is the active receiver, then movement of this receiver may cause a
perceivable change in sound due to the effects of the audio spatialization algorithms.
Programming Example
This chapter gives a simple example of using the 3D Positional Audio API and position the emitter using
a mouse pointer. Please refer to the chapter SoundFont Bank And Downloadable DRAM Services and
Real and Protected Mode API Programming Guide for explanation on using the MIDI and SoundFont
libraries.
#include <dos.h>
#include <stdio.h>
#include "ctaweapi.h"
volatile int count = 0;
void (interrupt far* prev_intr)();
/* previous interrupt handler */
newintr is a interrupt handler that hooks on to interrupt 1CH to get a 18.2Hz timer interrupt. The variable
count is incremented and serve as an indicator to the position update loop to update the emitter position.
void interrupt far newintr()
{
++count;
_chain_intr(prev_intr);
/* chain to previous interrupt */
}
Start of program.
main()
{
int current;
int x, y;
FILE *fp;
long bsize[2];
SOUND_PACKET sp;
WAVE_PACKET wp;
c3daEmitter em;
union REGS regs;
char preset[256];
char packet[PACKETSIZE];
For simplicity, assume that EMU8000 is at base addresses 0x620, 0x624 and 0x628. In Windows 95, a
recommended method would be to retrieve the base I/O address settings from the file CTPNP.CFG
located in the Windows directory. Refer to PART II DOS Real/Protected Mode API, under the
heading CTPNP.CFG Sample for more details on getting the base I/O addresses.
if (awe32DetectEx(0x620, 0x624, 0x628)) {
printf("Cannot detect SB AWE32\n");
return -1;
}
awe32InitHardware();
if (awe32DramSize == 0) {
printf("Not enough DRAM\n");
return -1;
}