Results 1 to 9 of 9

Thread: QT and sound?

  1. #1
    Join Date
    Jan 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X

    Question QT and sound?

    So...how do you add sound?
    Say, for example, I wanted a sound to go off when I pressed one of the buttons.

    Sorry if this is a "stupid question," but I'm new to QT.

    Thanks.

  2. #2
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QT and sound?

    hi ,
    you can try QSound http://doc.qt.nokia.com/4.7/qsound.html#details

    hope it helps
    bala

  3. #3
    Join Date
    Jan 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QT and sound?

    Thanks! Does QSound work for no matter which platform the program is running on?

    Thanks.

  4. #4
    Join Date
    Jan 2010
    Location
    Perth, Australia
    Posts
    37
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and sound?

    There's a list of platforms and supported sound formats in the link above

  5. #5
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: QT and sound?

    Depends on the system. QSound doesn't work on Linux if you don't have NAS installed. It's not supported on cell phones.

    I think your best shot is just to use Phonon.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  6. #6
    Join Date
    Jan 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QT and sound?

    Let me explain what I need this to do.

    This is for a school project, so I need it to be EASILY run on Mac, Windows and Linux systems.

    Will Phonon do the trick? Also, is it free to download? How easily does it work with Qt?

  7. #7
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: QT and sound?

    Phonon is shipped with Qt out of the box. You just have to add the flag to ./configure. It uses QuickTime on Mac, Linux GStreamer (VLC or Xine if you use the KDE version (but that requires KDE)), and on Windows DirectShow.

    It might require a little more work than QSound. But it's not that hard to use.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  8. #8
    Join Date
    Jan 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QT and sound?

    What do you mean by "add the flag to ./configure?"

    I'm REALLY sorry if these are seemingly stupid questions, but this is the first time I've EVER used Qt so if anyone could give me a step-by-step guide that'd be awesome.

  9. #9
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up Re: QT and sound?

    hi,
    refer this link for phonon http://doc.qt.nokia.com/4.7/phonon-overview.html

    When running the Qt configure script, you will be notified whether Phonon support is available on your system. As mentioned previously, to use develop and run Phonon applications, you also need to link to a backend, which provides the multimedia functionality.
    Mac OS X

    On Mac OS X, Qt uses QuickTime for its backend. The minimum supported version is 7.0.
    Linux

    The Qt backend on Linux uses GStreamer (minimum version is 0.10), which must be installed on the system. At a minimum, you need the GStreamer library
    Windows

    On Windows, building Phonon requires DirectX and DirectShow version 9 or higher. You'll need additional SDKs you can download from Microsoft.
    hope it helps
    bala

Similar Threads

  1. Phonon no sound
    By msaiia in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 30th November 2010, 06:18
  2. QMessageBox sound
    By wirasto in forum Qt Programming
    Replies: 4
    Last Post: 30th September 2010, 06:49
  3. Play .amr sound
    By ahmdsd_ostora in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2010, 15:34
  4. MP3 Sound / OGG Sound Play on GUI
    By patrik08 in forum Newbie
    Replies: 3
    Last Post: 1st September 2006, 19:01
  5. Sound on KDE 3.5
    By jaynewpeng in forum KDE Forum
    Replies: 6
    Last Post: 2nd February 2006, 13:06

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.