[Qt-interest] Phonon and raw audio data

Ahmed Toulan thelinuxer at gmail.com
Fri Jun 19 18:27:37 CEST 2009


 Hi guys,

I have some files written as raw audio data. The audio data I am trying to
read is encoded in 16 bits, has only 1 channel and with rate 16000Hz.

I tried to do the following :

-----------------------------------------------------------------------

QBuffer* buffer = new QBuffer(this);
buffer->setData(array);
Phonon::MediaObject *music = new Phonon::MediaObject(this);
Phonon::AudioOutput* audioOutput = new Phonon::AudioOutput(this);
Phonon::createPath(music, audioOutput);
Phonon::MediaSource mediaSource = Phonon::MediaSource(buffer);
music->setCurrentSource(mediaSource);
music->play();
------------------------------------------------------------------------

Where array is of type QByteArray containing some bytes from the audio
file. The only problem is that I can't find where to set the format. Is
there any way to play raw data in Phonon ?

Thanx in advance,
Ahmed Toulan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090619/afa6d014/attachment.html 


More information about the Qt-interest-old mailing list