added loopback example with adc samples and dac playback
[pcm-lib.git] / example / pc_speaker / sound_api.h
blob376c261d1b98b4cb48a9fe7b534d511beb7cda87
1 #ifndef _SND_API_
2 #define _SND_API_
6 /*
7 * sound API
8 */
11 * default set is the sample rate 44100, 16 bits, 2 channel
12 * umute
14 int32_t snd_init(void);
17 * write samples to device
18 * must have correct set before write
20 int32_t snd_write(uint8_t * pcmStream, uint32_t pcmCnt);
23 * collect resources of sound device
25 int32_t snd_deinit(void);
28 * set pcm sound format: sample rate, bit width, channel number
30 int32_t snd_set_format(uint32_t sampleRate, uint8_t bitWidth, uint8_t chNum);
33 * mute sound device
35 int32_t snd_mute(void);
37 * umute device
39 int32_t snd_umute(void);
42 * turn up sound volume
44 int32_t snd_vol_up(void);
47 * turn down sound volume
49 int32_t snd_vol_down(void);
50 #endif