fdave
Final Dave
Hi folks,
I'm writing some sound code and I have this so far:
I have a bit of sound, though it does change. Did I do something wrong?
Anyway, my real question is this, I want to poll the current position of the sound loop, and thought this function might do it:
But it always returns the same thing, 0xc0985a4. Any ideas?
I'm writing some sound code and I have this so far:
Code:
static int SoundLen=0;
static unsigned short *SoundWave=NULL;
int SoundInit()
{
SoundLen=735*4; // In samples
// Allocate circular buffer:
SoundWave=(unsigned short *)malloc(SoundLen<<2); if (SoundWave==NULL) return 1;
memset(SoundWave,0,SoundLen<<2);
SoundWave[0]=0x4000; //test
GpPcmInit(PCM_M44,PCM_16BIT);
GpPcmPlay(SoundWave,SoundLen<<2,1);
return 0;
}
int SoundExit()
{
GpPcmStop();
if (SoundWave) free(SoundWave);
SoundWave=NULL; SoundLen=0;
return 0;
}
I have a bit of sound, though it does change. Did I do something wrong?
Anyway, my real question is this, I want to poll the current position of the sound loop, and thought this function might do it:
Code:
int SoundPoll()
{
int idx=0;
unsigned int addr=0;
GpPcmLock(SoundWave,&idx,&addr);
return addr;
}
But it always returns the same thing, 0xc0985a4. Any ideas?