Convert C++ DirectSound 3D sample
We need to have a nice interface for the DirectX 3d-Sound sample of the DirectX9 SDK. This should result into a DLL. The Idea is to play four streams simultaneously, on each stream I like to say where the stream should come from. There are four directions: front-left, front-right, back-left, back-right. I like to set the direction of each stream.
The DLL has to be compatible with Windows XP, 2003 Server and Vista.
There is one little interface that starts the four streams and gets the steaming data from a callback-function.
The DLL should work with 16 Bit PCM data.
The DLL should work with 8000, 160000, and 44100 kHz sample frequency.
The DLL-Interface should be made as follows:
// enum soundcards
int WINAPI S3DGetNumSoundcards();
void WINAPI S3DGetSoundcardName( int cardIdx, char* buf, int bufSize );
// init soundcard
int WINAPI S3DInitSoundCard( LPCSTR sndCardName, LPFNS3D pfnDataCB );
void WINAPI S3DExit( );
// start operation
void WINAPI S3DStart( int sampleFreq, int frameSize );
void WINAPI S3DStop ( );
// callback function
typedef BOOL (CALLBACK * LPFNS3D)(int, short*, int );
Example:
// sound callback, will be called from the dll to get data
BOOL MySoundCallback( int channel, short* spkBuf, int numSamples )
{
// prepare some white noise
short randBuf[1024];
for( int i=0; i<1024; i++ ) {
randBuf[i] = (short)rand();
}
// copy the noise to speaker
memcpy( spkBuf, randBuf, bufSize*2 );
return 0;
}
Budget: Max. 1000,- US$
Timeframe: Very urgend!