PDA

View Full Version : Phonon on symbian



emrares
10th February 2012, 08:13
I connot play an mp3 file on my Nokia 5800 phone. The Qt example works fine but my code does not.

I get this error:

[Qt Message] "Loading clip failed: Not supported"

What am i doing wrong?




void GooglePlayer:: mediaFilePlaySlot( QByteArray audioData )
{

m_mediaFile = new QFile( "e:\response.mp3");
m_mediaFile->open( QIODevice::ReadOnly );
m_mediaFile->write( audioData );
m_mediaFile->close();

m_mediaObject->setCurrentSource(Phonon::MediaSource("e:\response.mp3"));
connect(m_mediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this, SLOT(stateChangedSlot(Phonon::State,Phonon::State) ));
}


void GooglePlayer::stateChangedSlot(Phonon::State newstate,Phonon::State oldState )
{
qDebug()<< newstate;
if ( newstate == Phonon::StoppedState )
m_mediaObject->play();

if( newstate == Phonon::ErrorState )
{
qWarning()<< m_mediaObject->errorString();
}
}


Pro file config:

# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
symbian:TARGET.CAPABILITY += ReadUserData
symbian:TARGET.CAPABILITY += WriteUserData
symbian:TARGET.CAPABILITY += UserEnvironment

QT += multimedia
QT += network
QT += webkit
QT += phonon
MOBILITY += bearer
MOBILITY += multimedia

Added after 1 8 minutes:

Maybe this is my problem ...

m_mediaFile->open( QIODevice::ReadOnly );

Sorry I am very tired

emrares
10th February 2012, 10:10
It works now. Sorry for the stupid question, I really tired...:(