audiowavfile.h 847 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __AUDIOWAVFILE_H__
  2. #define __AUDIOWAVFILE_H__
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "audiofile.h"
  8. // note: can only read *.wav format with g711 and pcm8 codec id.
  9. typedef struct audiowavfile_t audiowavfile_t;
  10. struct audiowavfile_t
  11. {
  12. audiofile_t base;
  13. int clock;
  14. int samplebit;
  15. int codec_pt;
  16. };
  17. #define AUDIO_FILE_CODEC_ALAW 8
  18. #define AUDIO_FILE_CODEC_MULAW 0
  19. #define AUDIO_FILE_CODEC_PCM8 102
  20. #define AUDIO_FILE_CODEC_PCM16 103
  21. apr_status_t audiowavfile_create(apr_pool_t *pool,
  22. audioengine_t *engine,
  23. const char *file,
  24. int opt,
  25. int clock, // 8k or 16k
  26. int codec_pt, // one of AUDIO_FILE_CODEC_xxx
  27. audiowavfile_t **p_file);
  28. void audiowavfile_destroy(audiowavfile_t *file);
  29. #ifdef __cplusplus
  30. } // extern "C" {
  31. #endif
  32. #endif //__AUDIOWAVFILE_H__