Results 1 to 4 of 4

Thread: Phonon - audio-output-problem and high latency

  1. #1
    Join Date
    Feb 2010
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Phonon - audio-output-problem and high latency

    Hey,

    after many problems, I get phonon "working":

    When I click on an area, a 1-second-sound should be played.

    My problem is, that I get this warnings and a big latency (1 second or something like this), before playing the sound:

    Qt Code:
    1. WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
    2. Qt Application(5432) Phonon::KdePlatformPlugin::createBackend: using backend: "Xine"
    To copy to clipboard, switch view to plain text mode 


    My Phonon-specific code is this:

    Qt Code:
    1. #include <phonon/audiooutput.h>
    2. #include <phonon/path.h>
    3. #include <phonon/mediaobject.h>
    4. #include <phonon/backendcapabilities.h>
    5.  
    6. // .....
    7.  
    8. Phonon::MediaObject *music =
    9. Phonon::createPlayer(Phonon::MusicCategory,
    10. Phonon::MediaSource("/home/fabi/Desktop/MobileDrumKit/MobileDrumKit/data/Music/15575_lewis_crash_bell.wav"));
    11. music->play();
    To copy to clipboard, switch view to plain text mode 

    I also tried to do this :

    Qt Code:
    1. QList<Phonon::AudioOutputDevice> audioOutputDevices =
    2. Phonon::BackendCapabilities::availableAudioOutputDevices();
    3. Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;
    4.  
    5. audioOutput->setOutputDevice(audioOutputDevices[0]);
    To copy to clipboard, switch view to plain text mode 

    but no luck...

    Thanks in advance.

    Also, I want to know, how big the latency between clicking and hear the sound is usually.

  2. #2
    Join Date
    Feb 2010
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Phonon - audio-output-problem and high latency

    Isn't there anybody out, who knows, why I have these problems?

  3. #3
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Phonon - audio-output-problem and high latency

    I also have this big latency, but only before first click! Seems on first click phonon loads all it's dlls,
    and next clicks play immediately.
    Who knows maybe is any possibility to "pre-initialize" phonon on start of application?

  4. #4
    Join Date
    Jun 2012
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Phonon - audio-output-problem and high latency

    Just for documentation, the link http://www.tuxradar.com/content/code...e-media-player has a solution for this problem:

    The error you describe is because Phonon is expecting the application to have a name defined through the Qt framework. This can be solved by adding:

    a.setApplicationName( "Mu" );

    to the 'main.cpp' file, just below the 'QApplication a(argc, argv)' line.

Similar Threads

  1. Phonon - Audio-Output-Problem
    By nearlyNERD in forum Newbie
    Replies: 4
    Last Post: 19th July 2010, 10:52
  2. Multiple sound files in Phonon Audio
    By brent99 in forum Qt Programming
    Replies: 0
    Last Post: 8th March 2010, 21:26
  3. Phonon(video and audio separately)
    By Fastman in forum Qt Programming
    Replies: 3
    Last Post: 1st February 2010, 06:30
  4. QTCreator phonon accessing audio acquisition device
    By rahul2047 in forum Qt Programming
    Replies: 4
    Last Post: 19th February 2009, 06:23
  5. Audio Recording with Phonon
    By Nemo in forum Qt Programming
    Replies: 4
    Last Post: 12th June 2008, 06:31

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.