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