[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    [Kde-games-devel] Re: Sound
From:       Andreas Beckermann <b_mann () gmx ! de>
Date:       2001-11-13 17:03:08
[Download RAW message or body]

On Tuesday 13 November 2001 17:38, thomas.friedrichsmeier@ruhr-uni-bochum.de 
wrote:
> Hi!

Hi

> I know there is detailed documentation on, say, arts out there, but
> really I don't feel like working through all this, esp. since arts-
> capabilities seem to me to be an overkill for what I would like to do.
> So maybe anybody could point me to some simple documentation
> or implemenation of the following things:

Ok, first of all I have to say that I have nearly no knwonledge in sound 
programming. Neither in KDE nor anywhere else.
btw there is a chapther in the KDE2 Development book about this. See 
http://www.andamooka.org/reader.pl?section=kde20devel

> 1. One-shot playing of a simple wav. I know this can be done easily
[..]
> 2. Playing and stopping a continuous sound, i.e. playing a wav file
> repetitiously and stopping playback at a point of time that is not
> known when the sound gets started.

The mentioned KDE2 bool covers this topic. In boson we currently use basically 
this code:
(void) new Arts::Dispatcher();
mSoundServer = new 
Arts::SimpleSoundServer(Arts::Reference("global:Arts_SimpleSoundServer"));
 if (SoundServer->isNull()) { // do *not* use mSoundServer now!!
        kdWarning() << "Sound could not be initialized - sound disabled" << 
endl;
 }

Now you can play a sound using
mSoundServer->play("/absolute/filename");

play() returns an ID - you can stop it using
mSoundServer->stop(ID);

> 3. Playing multiple sounds at once - I don't know whether this
> really is a problem for, say, KAudioPlayer, but if it is, maybe
> somebody can tell me what to use instead.

Should be not problem because of Arts.

> 4. (Optional, possibly I have to change my current concept here):
> Playback of wav-files at different speeds, ideally preserving the
> original pitch.

I cannot help you on this, sorry. This is probably possible with the 
simplesoundserver concept, too. Perhaps you find relevant stuff in the KDE2 
book.

> 5. Ideally of course, all this functionality would not require a very
> exotic lib in order to compile, but rather be part of some lib KDE
> uses anyway.

Arts. Boson currenlty uses
boson_LDADD = -lkdegames -lqtmcop -lsoundserver_idl $(LIB_KDEUI)
in the Makefile.am, where -lkdegames is the nice libkdegames, $(LIB_KDEUI) 
should be common for every KDE app and the rest is the sound stuff.

> Thanks,
> Thomas

CU
Andi
_______________________________________________
kde-games-devel mailing list
kde-games-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-games-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic