Spectrum analyzer sync and transform size.
Adam Luter <[email protected]>
| Newsgroups | gmane.comp.multimedia.xmms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I know that XMMS has a little spectrum analyzer and I was writing my own player that also has a spectrum analyzer. So I had two quick questions. My current analyzer works but I'm trying to tune it. The first question is synchronization. Currently I have a ring buffer that stores several 4k-ish raw pcm frames. Whenever this is full, the fourier transform runs on the whole thing. However, what is -played- would be the last sample in the buffer (that is the one on the end, the most recently added). Is this correct? Should the played sound be from roughly in the middle? Or at the beginning? The second question (which sorta makes the first moot) is that should I even bother with a ring buffer? When the buffer is really large the analyzer moves more slowly (of course), which could be considered 'pretty'. However, it's obviously harder on the CPU to do a larger fourier transform. Instead, couldn't I make do without the ring buffer and use an running average of each frame's transform? So I was just curious if you all, who have the experience, would suggest; happen to know what XMMS uses. XMMS is one of the best looking ones I've seen. (-The- best [IMHO] is the one on the empeg car jukebox, but that visualization library is proprietary). Thanks! Adam Luter p.s. Please CC.