home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / dsound / test it.c < prev   
Encoding:
C/C++ Source or Header  |  1994-01-11  |  849 b   |  29 lines  |  [TEXT/KAHL]

  1. /* test it.c */
  2.  
  3. void main( void )
  4. {
  5.     if( DS_InitSound() != noErr )            // Allocate soundchannels, etc.
  6.         SysBeep(0);
  7.     else
  8.     {
  9.         DS_LoadMusic( "\ploopback" );        // load in the music.
  10.         DS_SetMusicFlag( true );            // start the music.
  11.     
  12.         DS_SoundPlay( "\pforce", false );    // play a sound.
  13.         DS_WaitForQuiet();                    // wait for that sound to end.
  14.         
  15.         DS_SoundPlay( "\pfire", true );        // play a sound, clober existing sound.
  16.         DS_SoundPlay( "\pforce", false );    // play another sound, but don't clobber
  17.                                             // any existing sound. (you won't hear
  18.                                             // this one because "fire" will still
  19.                                             // be playing when this line is executed,
  20.                                             // and it will be ignored (becase a sound
  21.                                             // is playing)).
  22.             
  23.         while( !Button() )                    // wait for a mouseclick to end.
  24.             ;
  25.             
  26.         DS_DisposeSound();                    // lose the memory.
  27.     }
  28. }
  29.