Getting AudioDataOutput to return data

Rémi Benoit r3m1.benoit at gmail.com
Tue Mar 19 20:57:25 GMT 2013


Hi everyone,

I'm trying to get the data from AudioDataOutput in order to convert a file
read by Phonon in Ogg/Vorbis.

My problem is that the signal of AudioDataOutput::dataReady is never
called. Here is my code :

m_mediaObject = new Phonon::MediaObject( this );
m_audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
m_audioDataOutput = new Phonon::AudioDataOutput( m_mediaObject );


Phonon::createPath( m_mediaObject, m_audioDataOutput );
Phonon::createPath( m_mediaObject, m_audioOutput );

m_mediaObject->setCurrentSource(Phonon::MediaSource( QUrl( myUrl
).toLocalFile() ));

connect(m_audioDataOutput,

		SIGNAL(dataReady(const QMap<Phonon::AudioDataOutput::Channel,
QVector<qint16> >&)),
		this,
		SLOT(receiveData(const QMap<Phonon::AudioDataOutput::Channel,
QVector<qint16> >&)));

m_mediaObject->play();

void
VorbisConverter::receiveData(const QMap<Phonon::AudioDataOutput::Channel ,
QVector<qint16> > &data)
{
    tDebug() <<"Received Data from audio";
    tDebug() << data;
}

I use vlc-backend and when I try to launch this the music file get played
but the signal dataReady is never triggered. Also the bitrate from
audioDataOutput is always -1.
Is it a fault of the backend? I have libvlc 2.0.5 installed and the 0.5
vlc-backend.

I struggled finding any working example of audioDataOutput so i'm not sure
if this is the good way of doing things!

I saw in the previous post that AudioDataOutput had been turned into a sink
only, hence the path creation from MediaObject only.

I tried the old kind of path creation with :

    Phonon::createPath( m_mediaObject, m_audioDataOutput );
    Phonon::createPath( m_audioDataOutput, m_audioOutput );

But it gives me :

 [0xaee3dee0] main audio output error: no suitable audio output module

[0xa8743dc0] main decoder error: failed to create audio output

So I guess the first one is the good way ;)

Thanks for any help,
Rémi.

-- 
Rémi Benoit
Étudiant Master 1 Développement Logiciel
Université Paul Sabatier, Toulouse
Tel : +33 6 73 15 18 16
Mail : r3m1.benoit at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20130319/d692fcf5/attachment.htm>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list