One way is to call snd-spectrum using channel->float-vector to get the data. If you already have the fft data in snd, you can use the peaks function to write it either to the listener or a text file.