home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / cycles / sound.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.5 KB  |  87 lines

  1. /*
  2.  * sound.h
  3.  * 
  4.  * Nick Fitton - 18/01/1994
  5.  */
  6. #define MAXAUDIOPORT    3
  7.  
  8. extern short    sound_mode;
  9.  
  10. void    play_sound(const char *);
  11. void    pitch_cycle_sound(float );
  12. void    play_cycle_sound(void);
  13. void    init_audio(void);
  14. void    init_sound_flags(void);
  15. void    close_audio(void);
  16. void    change_cycle_pitch(float );
  17.  
  18. /********************* don't touch nuttin' below here ********************/
  19. /*
  20.  * aifflib.h
  21.  *
  22.  * Copyright (C) 1991, Silicon Graphics, Inc.
  23.  * All Rights Reserved.
  24.  */
  25. #ifndef __AIFFLIB_H
  26. #define    __AIFFLIB_H
  27.  
  28. #define    AIFF_NOMEM        -1    /* too many files open */
  29. #define    AIFF_OPENFAILURE    -2    /* can't open a file (check errno) */
  30. #define    AIFF_BADFD        -3    /* bad file descriptor */
  31. #define    AIFF_BADDATASIZE    -4    /* AIFF file has invalid data size */
  32. #define    AIFF_BADHEADER        -5    /* AIFF file has a bad header */
  33. #define    AIFF_NOTAIFF        -6    /* doesn't appear to be AIFF file */
  34. #define    AIFF_NOFORMCHUNK    -7    /* can't find the FORM header */
  35. #define    AIFF_BADCHUNK        -8    /* file is corrupt */
  36. #define    AIFF_WRITEFAILURE    -9    /* can't write to file */
  37. #define    AIFF_PARAMSFIXED    -10    /* can't change audio parameters */
  38. #define    AIFF_BADCHANNELS    -11    /* unsupported number of channels */
  39. #define    AIFF_BADWIDTH        -12    /* unsupported sample width (bits) */
  40. #define    AIFF_BADRATE        -13    /* unsupported sample rate */
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. typedef    int    AIFFfile;
  47.  
  48. /* all the functions returning int return -1 on error and set AIFFerrno */
  49.  
  50. AIFFfile    AIFFopen(const char* filename, const char* dir);
  51. int    AIFFclose(AIFFfile fd);
  52.  
  53. /* accepts and returns number of samples not bytes */
  54. int    AIFFwrite(AIFFfile fd, const void* buf, unsigned nsamp);
  55. int    AIFFread(AIFFfile fd, void* buf, unsigned nsamp);
  56. int    AIFFgetlength(AIFFfile fd);
  57.  
  58. int    AIFFgetchannels(AIFFfile fd);    /* returns 1 or 2 */
  59. int    AIFFgetwidth(AIFFfile fd);    /* returns 8, 16, or 24 */
  60. int    AIFFgetrate(AIFFfile fd);    /* returns 48000, 44100, 32000, etc. */
  61. int    AIFFsetchannels(AIFFfile fd, int channels);    /* takes 1 or 2 */
  62. int    AIFFsetwidth(AIFFfile fd, int width);    /* takes 8, 16, or 24 */
  63. int    AIFFsetrate(AIFFfile fd, int rate);    /* takes 48000, 44100, etc. */
  64.  
  65. /*
  66.  * functions to convert AL defines (AL_RATE_48000, AL_STEREO, etc.) to
  67.  * real numbers (48000, 2, etc.)
  68.  */
  69. int    CONVERTchannelstoAL(int nchannels);
  70. int    CONVERTwidthtoAL(int width);
  71. int    CONVERTratetoAL(int rate);
  72. int    CONVERTALtochannels(int ALnchannels);
  73. int    CONVERTALtowidth(int ALwidth);
  74. int    CONVERTALtorate(int ALrate);
  75.  
  76. extern int    AIFFerrno;
  77.  
  78. void    AIFFerror(const char *s);
  79. char*    AIFFstrerror(int err);
  80.  
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84.  
  85. #endif
  86.  
  87.