×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    QMediaPlayer on N8

    I am trying to find the simplest way to get an audio file to play on an N8. I have tried several examples but none work.

    The file exists in: c:\\Sound files\\Sound clips\\sound.mp3 and plays fine on the handset using the handset media player.

    I have tried searching for a solution and have even tried the "CONFIG += mobility phononfix" option without any joy.

    Thanks!

    Here is the code:


    Audio.pro
    ------------------------------------------------

    QT += core gui multimedia

    TARGET = Audio
    TEMPLATE = app

    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY = multimedia

    symbian
    {
    TARGET.UID3 = 0xecbb94d4
    TARGET.CAPABILITY += UserEnvironment NetworkServices ReadUserData
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }

    main.cpp
    ------------------------------------------------


    #include <QtGui/QApplication>
    #include "mainwindow.h"
    #include <qmediaplayer.h>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    QMediaPlayer *player;
    player = new QMediaPlayer;
    player->setMedia(QUrl::fromLocalFile("c:\\Sound files\\Sound clips\\sound.mp3"));
    // player->setMedia(QUrl::fromLocalFile("c:\\Sound files\\Sound clips\\sound.wav")); >> doesnt work either
    player->play();

    w.showMaximized();
    return a.exec();
    }

  2. #2
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Re: QMediaPlayer on N8

    Did you try to check what is a content of an error message?
    http://doc.qt.nokia.com/qtmobility-1...tml#error-prop

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: QMediaPlayer on N8

    what's the easiest way to do this?

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Re: QMediaPlayer on N8

    If message box is Ok with you, then you can show message in it
    QMessageBox::about(&w, "Error message", player->errorString());

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: QMediaPlayer on N8

    the error message was blank, both after setting the media and after attempting to play.

    I have since tried using Phonon and am using the following code:


    void MainWindow:layMyAudio()
    {
    Phonon::MediaObject *mediaObject;
    mediaObject = new Phonon::MediaObject();
    mediaObject->setCurrentSource(Phonon::MediaSource("e:\\music\\CRASH.MP3"));
    mediaObject->play();
    }

    I have a play button which calls this when it is clicked. This works!

    But, after the audio stops playing and I click on Play again, nothing happens. Any ideas?

  6. #6
    Registered User
    Join Date
    Mar 2009
    Posts
    28

    Re: QMediaPlayer on N8

    I have resolved this.

    restructured code and added a signal

  7. #7
    Registered User
    Join Date
    Jan 2011
    Posts
    1

    Re: QMediaPlayer on N8

    We have ported a S60 5th edition app to S^3 and are experiencing memory full messages (even though our app is the only one running) and slow audio playback when selecting certain streams. Anybody got any ideas?
    Last edited by aonghus; 2011-01-27 at 19:04.

  8. #8
    Registered User
    Join Date
    Jul 2011
    Posts
    1

    Re: QMediaPlayer on N8

    jintha tha jinthak jinthak tha

Similar Threads

  1. QtMobility QMediaplayer::SetMedia()
    By archerabi in forum [Archived] Qt Mobility Project
    Replies: 6
    Last Post: 2011-02-21, 13:25
  2. Never able to play mp3 file on N8 using QMediaPlayer
    By xhsoldier in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2010-12-10, 10:46
  3. QMediaPlayer : required capabilities
    By daudrain in forum [Archived] Qt Mobility Project
    Replies: 3
    Last Post: 2010-08-27, 05:01
  4. QVideoWidget and QMediaPlayer
    By JuanMendez in forum Qt
    Replies: 1
    Last Post: 2010-07-12, 15:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×