wave.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // Copyright (c) 1999 Relic Entertainment Inc.
  2. // Written by Janik Joire
  3. //
  4. // $History: $
  5. #ifndef WAVE_H
  6. #define WAVE_H
  7. // General constants
  8. #ifndef OK
  9. #define OK 0
  10. #endif
  11. #ifndef ERR
  12. #define ERR -1
  13. #endif
  14. // Other constants
  15. #define STOP 0
  16. #define PLAY 1
  17. #define WAVE_BUFSIZE 32768 // buffer about 32K
  18. #define WAVE_SAMPLERATE 22050 // sample rate
  19. #define WAVE_BITSAMPLE 16 // bits per sample
  20. #define WAVE_NUMCHAN 2 // number of channels
  21. // External functions
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. int InitWave(DWORD *dwNumDevs);
  26. int EndWave();
  27. int StartWavePlay(DWORD nDeviceID);
  28. int StopWavePlay();
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. // Internal functions
  33. int AllocWaveFormat();
  34. int FreeWaveFormat();
  35. int AllocWaveHeaders();
  36. int InitWaveHeaders();
  37. int FreeWaveHeaders();
  38. int AllocWaveBuffers();
  39. int FreeWaveBuffers();
  40. int CloseWavePlay();
  41. int QueueWaveBuffer();
  42. int ReadWaveBuffer();
  43. int GetFormatTagDetails(WORD wFormatTag);
  44. int GetFormatDetails(LPWAVEFORMATEX pFormatIn);
  45. // Thread functions
  46. int InitWaveThread(void);
  47. int CleanWaveThread(void);
  48. int CheckWaveThread(void);
  49. DWORD WINAPI ExecWaveThread(void);
  50. LRESULT CALLBACK WaveWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);
  51. #endif