how can i create a simple frequency spectrum from a sound playing like in XMMS
i'm doing a project in "computer controlled musical water fountain".
i have to create a player, play a song in it and read the instantaneous frequency of the song in the buffer in brief intervals of time. i used Java Media Framework (JMF) and also tried DirectX's DirectSound.getFrequency() method but both of them, as far as i know, only gave the frequency in samples per second.
what i really need is those sample values so that i can collect those values for brief interval of time, find out average and send the dominating frequency for that interval to electrical team who will activate the corresponding motors to create various patterns of the fountain.
As i think, this phenomenon is similar to the real-time frequency spectrum displayed in XMMS audio player in Linux where the instantaneous sampling values are captured and correspondingly displayed.
any kind of help will be highly appreciated !
|