PDA

View Full Version : phonon on symbian



GAUCHO
28th April 2011, 18:53
i'm new to QT. i'm tring to develop my first app on my nokia 5800 xm.
I installed all sdk (Qt SDK 1.1) and tools needed by qt on my windows(xp) desktop.
Then i built a empty qt mobility project where i added only a button.
The project (built on windows) runs without errors on my nokia.

In my project, i want to take an audio stream from microphone device and send
it to an output audio device.
I understood that i can use phonon class for my scope.

I only added on my mainWindow.cpp (at the beginning):

#include <phonon/AudioOutput>
..and on the button action i added:


Phonon::AudioOutput* pAudioOutput;
pAudioOutput = new Phonon::AudioOutput( Phonon::MusicCategory, this);

when i try to build the app i receive the following error:

warning: Can't find following headers in User or System Include Paths:
"audiooutput.h"

but if i go in C:\QtSDK\Symbian\SDKs\Symbian1Qt473\include\phonon i can find the audiooutput.h

What is wrong in my environment?

my easy test project can be downloaded from www.tr3ma.com/Dati/test2.zip

aamer4yu
28th April 2011, 19:21
Not sure about the phonon,,, but Qt has a spectrum analyzer demo which captures audio and plays it back...
You can check that example here (http://labs.qt.nokia.com/2010/05/18/qtmultimedia-in-action-a-spectrum-analyser/)

GAUCHO
29th April 2011, 15:36
I solved adding in the .pro file the row:

QT += core gui phonon

now that it works,
i added the remaining part of the code in file mainWindow.cpp:


#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#include <phonon/MediaSource>

and in sub on_pushButton_clicked() i added:


Phonon::AudioOutput* pAudioOutput;
pAudioOutput = new Phonon::AudioOutput( Phonon::MusicCategory, this);
Phonon::MediaObject* pMediaObject ;
pMediaObject = new Phonon::MediaObject(this);
Phonon::createPath(pMediaObject, pAudioOutput);
QString url= QString("e:\\Scream.wav");
Phonon::MediaSource mediaSource = Phonon::MediaSource(url);
pMediaObject ->setCurrentSource( mediaSource);
pMediaObject->play();

then i copied the file Scream.wav in the external memory (e: )
I verified that i can listen to this file on the default player of the phone.
And when i run the code, and press the button, the phone plays the wav.
Very good.

Now: How can i change the output device, choosing from available outputs? (for example in case i have 2 bluetooth headphone connected, and i want to stream a file only to one of these headphone).
I’ll study on this question.