Hello everybody,<div><br></div><div>I am new of gstreamer, so please forgive me if I say something wrong.</div><div><br></div><div>I need your help about performing some actions with gstreamer, I tried</div><div>reading tutorials and documentation but I didn't find the solution to a few</div>
<div>points, and I hoped you could help me figuring out some things.</div><div><br></div><div>I'm using gstreamer 0.10.35 on Mac OS, and developing a simple user</div><div>interface with python, QT and numpy (python-gstreamer, gobject, pyqt4).</div>
<div><br></div><div>I currently have two pipelines, one playing a simple note, using audiotestsrc,</div><div>and the other playing an mp3. I'm trying to visualize the spectrum of the</div><div>input signal (chosen by the user), so I connected to the "handoff" signal</div>
<div>of an identity element, and I'm playing around with the raw buffer received.</div><div>I have to draw the chart with frequencies in Hertz, and for doing so I'm </div><div>using the FFT function of numpy. Numpy however returns unitless </div>
<div>frequencies, so I need to know the stream bitrate, or the time duration </div><div>of the raw buffer, to convert such frequencies in Hertz. Moreover, I need</div><div>to reconstruct the original buffer, so I need to know the stream sample</div>
<div>width in order to pack the raw bytes.</div><div><br></div><div>This said, here my questions:</div><div>- how do I know the bitrate, or the milliseconds corresponding to the input</div><div>buffer received by an identity element with its handoff event? I tried using</div>
<div>the pipeline clock, but it doesn't seem to fit my needs;</div><div>- how do I know the actual sample width of the stream? I tried using </div><div>"audiosrc.get_pad("src").get_caps().get_structure(0)" but it gives me what </div>
<div>I guess are the accepted formats of the pad? I need the actual sample </div><div>width of the playing pipeline.</div><div><br></div><div>Thank you in advance for your time,</div><div>Best</div><div><br clear="all">--<div>
Dott. Stefano Parmesan<br>PhD Student ~ University of Trento<br></div><div><ahref Foundation - Trento - Italy<br>Tel: 0461-235794 ext. 5544</div><br>
</div>