[comp.sys.next] need some sound advice

raible@orville.nas.nasa.gov (Eric Raible) (05/18/89)

So can *you* figure out what the following program play any sound in
/NextLibrary/Sounds exactly 3 times?


#import <soundkit/Sound.h>

main (argc, argv)
     char *argv[];
     
{
  id sound = [Sound newFromSoundfile:argv[1]];

  while (1)
    {
      [sound play];
      [sound waitUntilStopped];
    }
}

ali@polya.Stanford.EDU (Ali T. Ozer) (05/19/89)

In article <2016@amelia.nas.nasa.gov> Eric Raible writes:
>So can *you* figure out why the following program plays any sound in
>/NextLibrary/Sounds exactly 3 times?
> [program deleted]

Bug in the sound library. Your program should of course play the sound over 
and over.

Try setting a delegate for the sound object and have the delegate's
didPlay: method play the sound. This should give you a repeating sound
that does play more than 3 times. It won't be continuous, however; there
will be a small (but audible) break in between. For a beep or ping type 
sound, this shouldn't be a problem. 

Ali Ozer, NeXT Developer Support
aozer@NeXT.com