title: Drawing audio spectrum with Bass library
body: <p>How can <strong>I draw an spectrum for an given audio file with <a href="http://www.un4seen.com/" rel="nofollow noreferrer">Bass library</a></strong>?</p>
  
  <p>I mean the chart similar to what Audacity generates:
  <img src="https://i.stack.imgur.com/kokEO.jpg" alt="enter image description here"></p>
  
  <p>I know that I can get the FFT data for given time <code>t</code> (when I play the audio) with:</p>
  
  <pre><code>float fft[1024];
  BASS_ChannelGetData(chan, fft, BASS_DATA_FFT2048); // get the FFT data
  </code></pre>
  
  <p>That way I get 1024 values in array for each time <code>t</code>. Am I right that the values in that array are signal amplitudes (<code>dB</code>)? If so, how the frequency (<code>Hz</code>) is associated with those values? By the index?</p>
  
  <p>I am an programmer, but I am not experienced with audio processing at all. So I don't know what to do, with the data I have, to plot the needed spectrum.</p>
  
  <p>I am working with C++ version, but examples in other languages are just fine (I can convert them).</p>