Library to analyse sound
I need in analyzing system output sound runtime. OS: Linux. The first thing I need is get different frequency values. Programming开发者_运维技巧 language: c++.
One semi-portable* way that comes to mind for grabbing all the sound from multiple sources is PulseAudio. (In this case, semi-portable means working with many sound cards, not working with different OSes, though there is a WinXP version of PulseAudio). One of the PulseAudio modules provides a pipe sink. Hopefully all your outputs will be PulseAudio-compatible - nearly everything that plays nice with ALSA should be fine. You should then be able to just read from that pipe to get your input.
You can then use a library like FFTW (first suggested by Thomas' answer) for fast Fourier transform, assuming this is what you mean by 'get the frequency values'.
*In this case, semi-portable means working with many sound cards, not working with different OSes, though there is a WinXP version of PulseAudio (haven't tried it myself).
The question is a bit vague, but here's some potentially useful information.
PCM-encoded WAV files are pretty easy to parse; you don't really need a library for that.
For the frequency analysis, I would use FFTW to do the Fourier transform.
精彩评论