0
0

Hi all

Im struggling to get data from FMOD_Channel_GetWaveData using Delphi. Does anyone have a short example they would be prepared to post?
Im not really sure what I should be using as the second argument here…

Thanks

  • You must to post comments
0
0

Hi, yeah the second parameter is wavedata. It wouldnt compile using an array of float but is ok now pointing to the first element of the array.
However, no values in the array seem to be changing. At first I thought it could be due to opening with the FMOD_HARDWARE flag, but I still cant get it to work.

The code Im using is: to start the stream

result := FMOD_System_CreateSound(xsystem, PChar(fPath), FMOD_SOFTWARE or FMOD_2D or FMOD_CREATESTREAM, nil, sound);
ERRCHECK(result);

result := FMOD_System_PlaySound(xsystem, FMOD_CHANNEL_REUSE, sound, TRUE, channel);
ERRCHECK(result);

FMOD_Channel_SetPaused(channel, FALSE);

Then to get the data (on a timer)
FMOD_System_Update(xsystem);

FMod_System_GetWaveData(channel, fData[0], 512, 0);

Can anyone see anything obviously wrong? Im sure its something simple…

  • You must to post comments
0
0

The GetWaveData function is ‘channel’ specific (in the conventional stereo sense), but I don’t think the function is channel specific in the FMOD sense; it returns whatever data happen to be playing on the left or right (but not both) audio channel [b:29wlow2k]at the system level.[/b:29wlow2k] Thus, shouldn’t the first parameter correspond to the FMOD system variable (in your example, xsystem)?

I’m not a big fan of GetWaveData, but maybe my hunch will solve your problem.

  • SD
  • You must to post comments
0
0

Youre right, I had originally been using FMod_Channel_GetWavedata, and must have changed over to system when trying to get it to work, but forgot to change the argument 😳
Thx Stddev its now working fine

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.