PDA

View Full Version : QT and sound?



fluffaykitties
27th January 2011, 06:30
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.

BalaQT
27th January 2011, 07:35
hi ,
you can try QSound http://doc.qt.nokia.com/4.7/qsound.html#details

hope it helps
bala

fluffaykitties
27th January 2011, 07:58
Thanks! Does QSound work for no matter which platform the program is running on?

Thanks.

hackerNovitiate
27th January 2011, 14:38
There's a list of platforms and supported sound formats in the link above

ComaWhite
27th January 2011, 16:32
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.

fluffaykitties
27th January 2011, 17:43
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?

ComaWhite
28th January 2011, 03:11
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.

fluffaykitties
29th January 2011, 06:45
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.

BalaQT
29th January 2011, 09:28
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