Hello world!!!
Please help me!!!
Someone can give me a simple example to just copy a Wav SRC into a another empty Wav DEST.
Thanks a lot!!!

  • You must to post comments

Merci beaucoup Brett !!!
Thank you very much !!!
I have successed to do something that works well:
Here is my code:

void CopySample()
FSOUND_SAMPLE *srcSamp, *destSamp;
int srcFreq, srcVol, srcPan, srcPri;
int destFreq, destVol, destPan, destPri, destChannel, destCurrent;
void *srcPtr1, *srcPtr2, *destPtr1, *destPtr2;
unsigned int srcLen1, srcLen2, destLen1, destLen2;

srcSamp = FSOUND_Sample_Load(FSOUND_FREE,”tada.wav”,FSOUND_NORMAL,0,0);
FSOUND_Sample_GetDefaults(srcSamp, &srcFreq, &srcVol, &srcPan, &srcPri);

destSamp = FSOUND_Sample_Alloc(FSOUND_FREE, 10*FSOUND_Sample_GetLength(srcSamp), FSOUND_Sample_GetMode(srcSamp), srcFreq, srcVol, 128, srcPri);
FSOUND_Sample_GetDefaults(destSamp, &destFreq, &destVol, &destPan, &destPri);

FSOUND_Sample_Lock(destSamp, 0, FSOUND_Sample_GetLength(srcSamp), &destPtr1, &destPtr2, &destLen1, &destLen2);
FSOUND_Sample_Lock(srcSamp, 0, destLen1, &srcPtr1, &srcPtr2, &srcLen1, &srcLen2);

memcpy(destPtr1, srcPtr1, destLen1);

destChannel = FSOUND_PlaySound (FSOUND_FREE, destSamp);

FSOUND_Sample_Unlock(srcSamp, srcPtr1, srcPtr2, srcLen1, srcLen2);
FSOUND_Sample_Unlock(destSamp, destPtr1, destPtr2, destLen1, destLen2);




Now I would like to know how to change the value of srcLen1 and srcLen2.
And this, in aim to copy just a portion of sample that not begining at the begin of the sample, and not finish at the end of the srcSample.

Thanks a lot!!!

  • You must to post comments

Thanks Brett, it’s formidable.
I’m trying all this, and it’s fantastique.

And I have a an another question?
Why I can’t change the Loop Mode durint the Playback.
I must stop the sound to have the Loop Mode takes effect.
Is it normal, or a mistake from me?

Regards !!!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.