Sound Libraries for C++
As far as getting the right libraries for playing sound, it should just be a matter of finding out what libraries are used by Phonon on your system. I know Phonon is a pretty big project and each OS has a different set of drivers for playing media and using Codec, etc. I would suggest looking at Audacity and VLC and checking Google.
Plugins/Libraries and Qt
As far as getting Phonon to work with Qt, I have experience there...
I haven't done a ton of testing with Phonon on every major OS, but I have on a few different versions of Windows.
The deployment of a Qt Application is very straight forward, even with plugins and libraries like Phonon. But figuring it out the first time was a little painful, just because the jargon is a little weird.
My answer is in the context of a Windows Desktop Application with Dynamic Linking to the Qt Libraries, not static.
Here is the directory structure for windows and a short explanation of how dlls are found.
Deploying a Qt Application
Dynamic-Link Library Search Order in Windows
For Mingw on Windows in the Qt SDK there is a folder for its binaries, and in that folder there are the dlls that your application needs to be able to find at runtime (If you are doing Dynamic Linking). I usually put these DLL's in the same folder as the Application EXE that I build in Qt creator and then keep the "Working Directory" or the directory that the EXE is ran from to be the same directory as well.
For the additional plugins/libraries that are for specific media types, like image formats and for phonon, you need to have a specific structure that your application can find it in.
You can make some very specific ones for your application and add them using the functions related to this call.
QStringList QCoreApplication::libraryPaths()
In general mimic the directory structure that you find in the MingW "plugins" folder for the additional dlls you need.
For example, I wanted to be able to show a system tray icon properly. Apparently you need the correct image format engine plugin to show the icon. (qgif4.dll
, qico4.dll
, and qjpeg4.dll
)
Here is were the plugin was located on my developing machine:
"C:\QtSDK\Desktop\Qt\4.7.3\mingw\plugins\imageformats"
Here is where I place it so that it can be found at runtime:
"C:\path\to\my\EXE\imageformats"
or
".\imageformats" (relative to my working directory of my EXE)
What is one of the more annoying things about discovering this information, is that the plugins don't fail in the same way as the main Qt Libraries, so you don't see it broken until you get to the part of your program that is actually attempting to use them.
phonon-backend-vlc
.port search phonon
reveals only gstreamer – Racer