Cannot play the same playObject more then once?

Bernd Donner Bernd_Donner at ph.tum.de
Fri Mar 12 03:52:01 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

What is wrong with the following code. It is supposed to play 4 times the same 
sound one after annother.

  KArtsDispatcher dispatcher;
  KArtsServer server;
  KDE::PlayObjectFactory factory( server.server() );

  KApplication a( argc, argv , "p2");
  KDE::PlayObject* playobj = factory.createPlayObject(
    KURL::fromPathOrURL("1.wav"), true );
  std::cerr << "The first one\n";
  playobj->play();
  sleep(2);
  playobj->halt();

  std::cerr << "The second one\n";
  playobj->play();
  sleep(2);
  playobj->halt();

  std::cerr << "The third one\n";
  playobj->play();
  sleep(2);
  playobj->halt();

  std::cerr << "The forth one\n";
  playobj->play();
  sleep(2);
  playobj->halt();

Instead the sound is only played twice: the first sound is played and the 
forth one. The other two are not played. This code was used on KDE 3.1.5, 
with slight modifications (due to API changes) the same effect happens on KDE 
3.1.4 and even KDE 3.2.1 did show the same behaviour.

I tend to believe that it is either a KDE bug or a library mismatch on debian 
- -- but maybe this code is missing something. The sound files can be really 
big thats why I don't want to create a playObject for the same sound file 
over and over again -- I know that the problem is quite often attacked by 
this approach. Since the sound files can be really big I also don't want to 
use knotify.

So is this code supposed to work on a correctly installed system?
I have attached the complete sources with a small make script and the used 
sound.

Bernd


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFAUTPhHdUz1bEQlxsRAotrAJ99ku43JXdC4pB1u5ck3ZwNlNmTUQCfZ8Ln
pTiBkbSvUUVgyvFbyahjaNg=
=FZKW
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdesound.tar.bz2
Type: application/x-tbz
Size: 5496 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-multimedia/attachments/20040312/83670c19/attachment.bin>
-------------- next part --------------
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list