Skip to main content
Topic: vis.h (Read 1810 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

vis.h

Quote
struct vis_chunk
{
   vis_sample * data;
   unsigned samples;// sizeof(data) == sizeof(vis_sample) * samples * nch;
   unsigned srate,nch;
   vis_sample * spectrum;
   unsigned spectrum_size;// sizeof(spectrum) == sizeof(vis_sample) * spectrum_size * nch;

   inline double get_duration() {return srate>0 ? (double)samples / (double)srate : 0;}

};//both data and spectrum are channel-interleaved


i am back to annoy you with more evil questions  i hope they make some sense.

1. what's the range of the floats in vis_chunk->data? are they values from 0 to 1?
2. same question for vis_chunk->spectrum.
3. how many floats are there in vis_chunk->data and vis_chunk->spectrum on every on_data()-call? i guess that "samples" is the number of floats in the chunk, but i am probably wrong...

thanks in advance,

pcween

 

vis.h

Reply #1
1) -1...1 (but may exceed that range if signal clips)
2) 0...+∞
3)
Quote
struct vis_chunk
{
vis_sample * data;
unsigned samples;// sizeof(data) == sizeof(vis_sample) * samples * nch;
unsigned srate,nch;
vis_sample * spectrum;
unsigned spectrum_size;// sizeof(spectrum) == sizeof(vis_sample) * spectrum_size * nch;

inline double get_duration() {return srate>0 ? (double)samples / (double)srate : 0;}

};//both data and spectrum are channel-interleaved

 
SimplePortal 1.0.0 RC1 © 2008-2019