0
0

Hey guys, I have an old piece of code written some years ago. How can I translate this lines?

float RIGHT, LEFT;
FSOUND_GetCurrentLevels(channel, &RIGHT, &LEFT);

Many thanks in advances!

  • You must to post comments
0
0

use Channel::getWaveData instead. You can either read one value or scan the whole array and get a more accureate level.

  • You must to post comments
0
0

Ok, brett! I follow your suggestion and I write this code:
[code:29rzm89s]

include <iostream>

include <fmod.h>

include <fmod_errors.h>

include <math.h>

int main()
{
FMOD_SYSTEM *sys;
FMOD_SOUND *stream;
FMOD_CHANNEL *channel=0;
FMOD_RESULT result;
char *song="./foo.mp3";
static float wavedata[256];
unsigned int time=0, old_time=0;
unsigned int tps;
int playing = 0;

result=FMOD_System_Create(&sys);
result=FMOD_System_Init(sys,32,FMOD_INIT_NORMAL,NULL);
result=FMOD_System_CreateSound(sys,song,FMOD_SOFTWARE|FMOD_CREATESTREAM,0,&stream);
result=FMOD_System_PlaySound(sys, FMOD_CHANNEL_FREE, stream, 0, &channel);

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

  printf(&quot;[waveData[130]:%ld]\n&quot;, (abs((int)(100 * wavedata[130]))));

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

} while (playing);

return 0;
}
[/code:29rzm89s]

Now, how can I determine a pair of value describing R-channel and L-channel? 8)

  • You must to post comments
0
0

notice the last parameter is ‘channeloffset’. 0 = left and 1 = right.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.