[Kde-games-devel] Junior job not only for GSoCers: Low-latency sound playback with KgSound

Ian Wadham iandw.au at gmail.com
Sun Mar 18 04:50:51 UTC 2012


On 18/03/2012, at 12:07 PM, Roney Gomes wrote:

> On 03/07/2012 08:10 PM, Stefan Majewsky wrote:
>> If you decide to work on porting a game, do not hesitate to ask for
>> further assistance on this mailing list. Once your patch is done,
>> upload it to http://svn.reviewboard.kde.org to get it reviewed.
> 
> Hi, I began to browse Kapman's source code in an attempt to port it to KgSound, but some doubts came to my mind. Here follows the first.
> 
> In the following assignment:
> m_media1 = Phonon::createPlayer(Phonon::Gamecategory)
> 
> A sound file is "attached" to m_media1, but in the documentation[1] I saw that this function takes a second argument (const MediaSource& source), that is the source of the sound file itself.

Two things to look at more closely:
a) that second argument is a generalisation of a media source (not necessarily a file) and is optional,
b) kapman is using two media players, m_media1 and m_media2.

> So, taking in consideration that I can't explicitly see the file passed, wich file should I choose when calling the KgSound's constructor?

Phonon opens a file every time it plays a sound and is not good at playing short sounds promptly
and overlapping them correctly.  That is why we are switching to KgSound and OpenAL library
for sounds in games.  You may need to experiment and think about how to use KgSound and
OpenAL to best effect, e.g. whether to open and load all the sound files at startup time.

Cheers, Ian W.



More information about the kde-games-devel mailing list