0
0

I’m doing this for encryption.
FSOUND_Sample_Load, FSOUND_Sample_Lock, and change the data of sample, it is clear. But result is discouraging.

The sample is tested by FSOUND_PlaySoundEx. And, I found the sample isn’t changed at all. It plays just the sound loaded by FSOUND_Sample_Load.

How can I change the each data of ptr1.

===========================================
FSOUND_SAMPLE* samp = FSOUND_Sample_Load(FSOUND_FREE, pathName, FSOUND_HW3D, 0, 0);

signed short* ptr1=NULL,ptr2=NULL;
unsigned int len1,len2 = 0;
FSOUND_Sample_Lock(samp, 0,44100
2, (void)&ptr1, (void)&ptr2, &len1, &len2);
for( int i=0; i<len1; i++)
{
ptr1[i] = 100*( (i/100)%2==0? 1:-1);
}
FSOUND_Sample_Unlock(samp, &ptr1, &ptr2, len1, len2);

FSOUND_PlaySoundEx( FSOUND_FREE, samp, NULL, FALSE);

  • You must to post comments
0
0

I don’t understand why your application doesn’t crash when you execute that code ๐Ÿ˜‰

You’ve got a pointer to the locked pcm data (Ptr1) and then you have an array called Ptr1?

I don’t program in this language, but it looks like you are confusing Ptr1 (a pointer to the data you’ve locked) with the pcm data. Try copying the locked data to an array (Ptr1 tells you where the data are), and then manipulate the array.

Regards,

  • SD
  • You must to post comments
0
0

FSOUND_Sample_Unlock(samp, ptr1, ptr2, len1, len2);

It works fine. I don’t know why the previous one didn’t through any error.
Maybe you are toooo good at exception handling. ๐Ÿ˜€ ๐Ÿ˜€

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.