Results 1 to 6 of 6

Thread: Phonon Cannot Play Sound (without Error)

  1. #1

    Default Phonon Cannot Play Sound (without Error)

    Hi,
    I am trying to build a simple Phonon application. I have tried a simple code like:

    Qt Code:
    1. QApplication::setApplicationName("panda");
    2. QList<AudioOutputDevice> ss=Phonon::BackendCapabilities::availableAudioOutputDevices();
    3. MediaObject *m_media;
    4. m_media = new Phonon::MediaObject(this);
    5. Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
    6. //audioOutput->setOutputDevice(Phonon::AudioOutputDevice::fromIndex((((AudioOutputDevice)ss.at(0)).index())));
    7. createPath(m_media, audioOutput);
    8. MediaSource m=MediaSource("/FileSpace/n.mp3");
    9. m_media->setCurrentSource(m);
    10. m_media->play();
    To copy to clipboard, switch view to plain text mode 

    This code compiled and ran w/o any error, however I do not get any output.

    I have also tried Media Player example in Qt site, in that, when I push play button immediately playing ends.

    Any thoughts or comments?

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon Cannot Play Sound (without Error)

    Quote Originally Posted by padawan View Post
    This code compiled and ran w/o any error, however I do not get any output.
    On what os platform you are trying?

    Qt Code:
    1. QList<AudioOutputDevice> ss=Phonon::BackendCapabilities::availableAudioOutputDevices();
    To copy to clipboard, switch view to plain text mode 
    Can you please get the count of ss?

    Quote Originally Posted by padawan View Post
    I have also tried Media Player example in Qt site, in that, when I push play button immediately playing ends.
    What is the length of sound file you tried with?

  3. #3

    Default Re: Phonon Cannot Play Sound (without Error)

    Quote Originally Posted by yogeshgokul View Post
    On what os platform you are trying?
    xubuntu linux

    Can you please get the count of ss?
    3;
    10001 - ALSA default output
    10002 - OSS default output
    10000 - PulseAudio

    BTW, I have tried to change output device by uncommenting the line you mentioned and using 3 different IDs


    What is the length of sound file you tried with?
    a few minutes long mp3 song

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Phonon Cannot Play Sound (without Error)

    Check for "gstreamer", is it properly installed on your environment. Well I guess, it is. Thats why you are getting the list of 3 devices.
    Check is you can playback mp3 on same environment by any tool. This will test for sound codecs and output devices.

  5. #5

    Default Re: Phonon Cannot Play Sound (without Error)

    Hi,
    gstreamer and some related packages are installed (but not everything that contains gsreamer), but anyway, MP3 playback is without problem in the system with any other software.

  6. #6
    Join Date
    Nov 2008
    Posts
    16
    Thanks
    2
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Phonon Cannot Play Sound (without Error)

    Try running it with PHONON_GST_DEBUG=3. For example, to run "myApp"

    PHONON_GST_DEBUG=3 ./myApp -qws

    It outputs a lot of helpful info of what's actually going wrong

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 11:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 14:43
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 03:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 13:19
  5. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 25th August 2006, 00:31

Tags for this Thread

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.