[PyQt] Access the audio data from input pipes of a
Phonon::MediaNode to implement a audio visualization widget
Christian
chrisde88 at yahoo.de
Mon Mar 23 18:38:18 GMT 2009
Hi,
I am new to the phonon module of qt4, but I am already fascinated by the
pipe concept. After reading a bit in the documentation it was very easy
to implemented a basic sound player. Then I thought about the pipe
concept, where you could have multiple Audio Sinks for a single Audio
Object. The documentation says, that a audio sinks would represent a
virtual audio device and can be used to manipulate the media. The system
seems to be very flexible, hence it should be easy to implement a audio
visualization widget, which is feed by such a virtual audio device with
some preprocessed data. That virtual audio device would be a audio sink
piped to the MediaObject in addition to a AudioOutput object. The
visualisation could be a oscilloscope or frequency spectrum.
But still after reading through the whole phonon documentation I have no
clue how the internal data flow works. I haven't found any buffer object
I could access or any signals and slots which are used to pass the data
from the input object of a pipe to the output object. A quick peek at
the Qt4.4.2 source code was also hopeless, it was very difficult for me
to grasp the data flow and I still don't know which variables are used.
I like the separation of the module. The media source is used for
buffering the data, the media object supplies a user interface for the
audio stream and the media device is used to output the actual sound,
all linked together with pipes. Now My question is, how can I access the
decoded raw data, which is send for example to the physical audio
device. There is also the possibility to plug in filters to the pipes
and manipulate the audio data itself, but I have still no idea how to
access it.
Perhaps I have overlooked a obvious part of the phonon module or a
mechanism of the MediaNode to access its data send from the input pipes.
Can you please help me.
Thanks in advance
Christian
References:
http://doc.trolltech.com/4.4/phonon-overview.html
http://doc.trolltech.com/4.4/phonon-module.html
More information about the PyQt
mailing list