audioresample.h 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __AUDIORESAMPLE_H__
  2. #define __AUDIORESAMPLE_H__
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "audiostream.h"
  8. typedef struct audioresample_t audioresample_t;
  9. struct audioresample_t
  10. {
  11. audiostream_t base;
  12. int upstream_rate;
  13. int downstream_rate;
  14. int quality; // 0 - 10 (best)
  15. void *read_state;
  16. void *write_state;
  17. unsigned int upstream_psize;
  18. unsigned int downstream_psize;
  19. audioframe_t read_resampled_frame;
  20. audioframe_t write_resampled_frame;
  21. };
  22. // 16bit pcm data
  23. apr_status_t audioresample_create(apr_pool_t *pool,
  24. audioengine_t *engine,
  25. int upstream_rate,
  26. int downstream_rate,
  27. int quality,
  28. audioresample_t **p_resample);
  29. void audioresample_destroy(audioresample_t *resample);
  30. #ifdef __cplusplus
  31. } // extern "C" {
  32. #endif
  33. #endif //__AUDIORESAMPLE_H__