Example #1
0
int main()
{
  sound_Start(FRAMES, RATE, 1, 3);
  for (;;)
    {
      int n= min(sizeof(sound), sound_AvailableSpace()) / 4;
      if (n)
	{
	  warble(n);
	  sound_PlaySamplesFromAtLength(n, (int)sound, 0);
#        if (DEBUG)
	  putchar('.');  fflush(stdout);
#        endif
	}
      else
	usleep(1000);
    }
  (void)sound_InsertSamplesFromLeadTime;
  (void)sound_PlaySilence;
  (void)sound_GetRecordingSampleRate;
  (void)sound_StartRecording;
  (void)sound_RecordSamplesIntoAtLength;
  (void)sound_Volume;
  (void)sound_SetVolume;
  (void)sound_SetRecordLevel;
  return 0;
}
Example #2
0
/* The Solaris STREAMS audio driver sends a SIGIO
 * each time it reads the EOF sent by sound_PlaySamplesFromAtLength */
static void auHandle(int sig)
{
  PRINTF(("(sig=%d)", sig));
  if (auFd < 0) return;

  /* Not all SIGIOs are for us */
  if (sound_AvailableSpace() > 0)
    {
      PRINTF(("Signalling semaphore %d", auPlaySemaIndex));
      signalSemaphoreWithIndex(auPlaySemaIndex);
    }
}