Results 1 to 3 of 3

Thread: phonon on symbian

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default phonon on symbian

    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):
    Qt Code:
    1. #include <phonon/AudioOutput>
    To copy to clipboard, switch view to plain text mode 
    ..and on the button action i added:

    Qt Code:
    1. Phonon::AudioOutput* pAudioOutput;
    2. pAudioOutput = new Phonon::AudioOutput( Phonon::MusicCategory, this);
    To copy to clipboard, switch view to plain text mode 

    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



  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: phonon on symbian

    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

  3. #3
    Join Date
    Apr 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: phonon on symbian

    I solved adding in the .pro file the row:
    Qt Code:
    1. QT += core gui phonon
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. #include <phonon/AudioOutput>
    2. #include <phonon/MediaObject>
    3. #include <phonon/MediaSource>
    To copy to clipboard, switch view to plain text mode 

    and in sub on_pushButton_clicked() i added:

    Qt Code:
    1. Phonon::AudioOutput* pAudioOutput;
    2. pAudioOutput = new Phonon::AudioOutput( Phonon::MusicCategory, this);
    3. Phonon::MediaObject* pMediaObject ;
    4. pMediaObject = new Phonon::MediaObject(this);
    5. Phonon::createPath(pMediaObject, pAudioOutput);
    6. QString url= QString("e:\\Scream.wav");
    7. Phonon::MediaSource mediaSource = Phonon::MediaSource(url);
    8. pMediaObject ->setCurrentSource( mediaSource);
    9. pMediaObject->play();
    To copy to clipboard, switch view to plain text mode 

    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.

Similar Threads

  1. Symbian WAP Apn
    By Hollow Heart in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 10th October 2010, 15:14
  2. Playing Ogg Vorbis with Qt Phonon on Symbian^1
    By freemind in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 16th September 2010, 14:11
  3. Replies: 1
    Last Post: 9th September 2010, 16:49
  4. GL For Symbian
    By TJSonic in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 21st June 2010, 23:43
  5. In Symbian?
    By martinn in forum Qwt
    Replies: 1
    Last Post: 25th February 2010, 10:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.