[Gambas-user] gb.media : receiving GStreamer element messages

Adrien Prokopowicz Adrien.PROKOPOWICZ at ...3478...
Mon May 11 02:52:43 CEST 2015


Hello everyone,

So I wanted to play a bit with the "spectrum" GStreamer element.
After reading the documentation, I noticed that it used "element messages"
to send the spectrum data to the application, but gb.media does not have
an interface to catch these.

I made a quick and dirty patch at first, but I think that after some
cleanup
it would be nice to share. So here it is (see the attached patch).
(I named the data class MediaData here, but I think there might be
a better name for it.)

In order to see it in action, I made a small application that shows
the spectrum of an audio file while playing it.
It also tweaks the data to look nicer on the visualizer (basically
changing the frequency scale to a logarithmic one, and smoothing the
result),
but you can disable it in the configuration menu if you want.

The app itself is completely useless, but I find it quite fun to watch.
However, processing and rendering the data takes a significant amount of
power, so it might lag if you have a small CPU.
If it lags too much for you, you can lower some rates in the
SpectrumPlayer class.

What do you think ?

Regards,
-- 
Adrien Prokopowicz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AudioSpectrum-1.0.tar.gz
Type: application/x-gzip
Size: 8036 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150511/fcc84bbe/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gb.media_src.diff.gz
Type: application/x-gzip
Size: 1964 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150511/fcc84bbe/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: audiospectrum.png
Type: image/png
Size: 11998 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150511/fcc84bbe/attachment.png>


More information about the User mailing list