common.h 866 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef __COMMON_H
  2. #define __COMMON_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct {
  7. snd_pcm_t *handle;
  8. snd_pcm_format_t format;
  9. unsigned int rate;
  10. unsigned int channels;
  11. snd_pcm_uframes_t period_size;
  12. snd_pcm_uframes_t buffer_size;
  13. snd_pcm_uframes_t frame_bytes;
  14. snd_pcm_uframes_t chunk_size;
  15. unsigned in_aborting;
  16. unsigned int capture_duration;
  17. } audio_mgr_t;
  18. void xrun(snd_pcm_t *handle);
  19. void do_other_test(snd_pcm_t *handle);
  20. void do_pause(snd_pcm_t *handle);
  21. int set_param(snd_pcm_t *handle, snd_pcm_format_t format,
  22. unsigned int rate, unsigned int channels,
  23. snd_pcm_uframes_t period_size,
  24. snd_pcm_uframes_t buffer_size);
  25. audio_mgr_t *audio_mgr_create(void);
  26. void audio_mgr_release(audio_mgr_t *mgr);
  27. #ifdef __cplusplus
  28. }; // extern "C"
  29. #endif
  30. #endif /* __COMMON_H */