0
0

I would like to draw the wave during loading or playing music.
Could you give me some advice?
Use ReadData() or getWaveData() or others?
I tried these two method, but get the many data. how to handle them?

many thanks.[/img]

  • You must to post comments
0
0

while playing, use getWaveData, that’s what it is for.
You can specify how much data you want.

  • You must to post comments
0
0

pcode

//init
const MAXENTRIES = 64;
float left[MAXENTRIES];
float right[MAXENTRIES];

//main loop
while playing
{
memset left and right to 0 sizeof float * MAXENTRIES

getWaveData &left
getWaveData &right

int x = 0;
int width = 300;
int height = 100;
int y = 400;
for (int i=0; i<MAXENTRIES-1; i++)
{
drawLine(x,y+heightleft[i],x+width/MAXENTRIES,y+heightleft[i+1])
drawLine(x,y+heightright[i],x+width/MAXENTRIES,y+heightright[i+1])
x+=width/MAXENTRIES;
}

fmod update
}

Have fun.

  • You must to post comments
0
0

what did you pass to getwavedata? And are your sounds loaded with FMOD_SOFTWARE?

  • You must to post comments
0
0

brett,
I would like to draw 70 point per second. But i get much data from getWaveData(). How to get the right data from the result?
Many thanks.

icuurd12b42,
thanks. I will try this code.

  • You must to post comments
0
0

If you take a look at the "dsppluginviewer" example, it draws the wavedata while the sound is playing.

  • You must to post comments
0
0

You have to get 32/64/128/256 and so on points when you call GetData.

you can skip over points if your fps drops.

I use some logic to gradually draw more points from the 32 I got (n/32). if the FPS is still good, I switch to grab 64 points, drawing 32 then 34, all the way up to 64 (n/64). I repeat the process, grabing more data, until the fps drops.

I reverse the process when the fps is below aceptable speed.

  • You must to post comments
0
0

I use ZedGraph to draw the waveform and FFT graph of the data in C#, its a very extensive graphing tool

[url:31d9qcep]http://zedgraph.org/wiki/index.php?title=Main_Page[/url:31d9qcep]

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.