PDA

View Full Version : Frequency of Audio Track



vijay_kansal
24th July 2010, 18:37
Hi,
I want to develop an audio editor using Qt.
For this, I need to plot a waveform of the music track which I think should be a plot of frequency of sound versus time(please correct me if I am wrong).

Currently, I have been using Phonon::AudioOutput class object as an audio sink and connected it with my Phonon::MediaObject class object to play the audio file.

Now, to draw the waveform I need to know the frequeny of audio track at every second (,or so) from this AudioOutput object so that I can draw a line (using QPainter) of length proportional to sound frequency at different times and hence, obtain my waveform.

So, please help me on how to obtain frequency of audio tracks at different times.
Thanks

SixDegrees
24th July 2010, 18:40
I can't help you with this, but what you want is the amplitude of the sound, not the frequency. To obtain the frequency, you would need to run the sound file through a Fourier Transform, and I doubt that's what you want to do.

vijay_kansal
24th July 2010, 18:46
okay

But, how can I then obtain the amplitude of my audio file using AudioOutput object (or any other class object)?

Secondy,am i using the correct way of plotting waveforms of audio tracks - plotting amplitudes of sound against time by plotting lines by Qpainter object on a widget at different times.

Thanks

wysota
24th July 2010, 23:36
You can't get access to audio or video data through Phonon, it's only for playback. You can use the QtMultimedia module though.

grabalon
27th July 2010, 18:07
Check out QwtPlot, it might make life easier

aamer4yu
28th July 2010, 10:15
There's also a spectrum analyser (http://labs.trolltech.com/blogs/2010/05/18/qtmultimedia-in-action-a-spectrum-analyser/) example in latest qt demo. Check that out. :)