0
0

Hi everybody !
I have a problem using Channel::GetWaveData. I use it as a getLevel one, meaning i have an array with only one value. But this value never changes and probably corespond to nothing.
my code :
[code:2bun0671]int main()
{
FMOD_SYSTEM *sys;
FMOD_SOUND *stream;
FMOD_CHANNEL *channel=0;
FMOD_RESULT result;
char *song="./eric.mp3";
float * wavedata;
unsigned int time=0, old_time=0;
int playing = 0;

result=FMOD_System_Create(&sys);
ERRCHECK(result);

result=FMOD_System_Init(sys,32,16,FMOD_INIT_NONREALTIME,NULL);
ERRCHECK(result);

result=FMOD_System_CreateSound(sys,song,(FMOD_MODE)(FMOD_HARDWARE| FMOD_2D | FMOD_CREATESTREAM),0,&stream);
ERRCHECK(result);

result=FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, stream, 0, &channel);
ERRCHECK(result);

do {
FMOD_Channel_GetPosition(channel,&tps,FMOD_TIMEUNIT_MS);
FMOD_Channel_GetWaveData(channel,wavedata,1,0);

  if (time-old_time >= 1000) {
     old_time=time;
     printf("[waveData[0]:%lf]\n", *wavedata);
  }

  FMOD_Channel_IsPlaying(channel,&playing);      
  FMOD_System_Update(sys);

} while (playing);

return 0;
}[/code:2bun0671]
Thanx to help me.

  • You must to post comments
0
0

Sorry … my bad 😳

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.