0
0

[code:38pcn23l] PCM_Data = new short int[dataSize];

WAVEFile.read((char*)PCM_Data, dataSize);[/code:38pcn23l]

What I want to do is first create an FMOD Sample definition (i know how to do that) and then write all the data from the PCM_Data array to the sample definition.

I’ve been struggling to get to grips with lock and unlock but I’m guessing they have something to do with it.

EDIT: ok i have just discovered FSOUND_Sample_Upload (which is really great).

So now my code looks like this

[code:38pcn23l]PCM_Data = new short int[dataSize];

WAVEFile.read((char*)PCM_Data, dataSize);

FSOUND_SAMPLE* sample = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_STEREO | FSOUND_16BITS, 44100, 255, 128, 255);

FSOUND_Sample_Upload(sample, PCM_Data, 0);

FSOUND_PlaySound(1, sample);[/code:38pcn23l]

btw RECORDLEN is 44100*120.

Now the problem is this: even though the data is 2 minutes long, only about 20-40 seconds of it play. any idea why that is?

  • You must to post comments
0
0

[quote="brett":oa8ou670]i think the problem is you didnt define any source mode for the data in FSOUND_Sample_Upload.
if you put FSOUND_STEREO | FSOUND_16BITS then it will probably copy the right amount to the sample instead of a quarter of it because i think it thought your data was 8bit mono.[/quote:oa8ou670]

thanks!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.