home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol1 / Audio / palaudio.src < prev    next >
Encoding:
Text File  |  1999-10-27  |  741 b   |  24 lines

  1. (c)  Copyright 1989-1999 Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice, and 
  3. is provided "as is" without warranty of any kind, either expressed or implied.  
  4. The entire risk as to the use of this information is assumed by the user.
  5.  
  6.  
  7. #define NTSC_CLOCK (3579545)
  8. #define PAL_CLOCK  (3546895)
  9.  
  10. ULONG clock, clockx100, periodx10, period, hertzx10, sampleBytes;
  11.  
  12. /* Check GfxBase->DisplayFlags and set clock to appropriate value
  13.  * Set hertzx10 to 10 * desired frequency in hertz
  14.  * Set sampleBytes to number of bytes in the one cycle waveform sample
  15.  */
  16.  
  17. clockx100 = 100 * clock;
  18. periodx10 = (clockx100 / hertzx10) / sampleBytes;
  19. /* round off */
  20. period = (periodx10 + 5) / 10;
  21.  
  22.      
  23.  
  24.