2 * Copyright (C) 2015, 2016 "IoT.bzh"
3 * Author "Manuel Bachmann"
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
22 #include <alsa/asoundlib.h>
24 #include "audio-api.h"
26 #define AUDIO_BUFFER "/tmp/audio_buf"
28 typedef struct dev_ctx_alsa dev_ctx_alsa_T;
33 snd_pcm_hw_params_t *params;
34 snd_mixer_elem_t *mixer_elm;
35 snd_mixer_elem_t *mixer_elm_m;
39 unsigned char thr_should_run;
40 unsigned char thr_finished;
43 unsigned char _alsa_init (const char *, audioCtxHandleT *);
44 void _alsa_free (const char *);
45 void _alsa_play (int);
46 void _alsa_stop (int);
47 unsigned int _alsa_get_volume (int, unsigned int);
48 void _alsa_set_volume (int, unsigned int, unsigned int);
49 void _alsa_set_volume_all (int, unsigned int);
50 unsigned char _alsa_get_mute (int);
51 void _alsa_set_mute (int, unsigned char);
52 void _alsa_set_channels (int, unsigned int);
54 void* _alsa_play_thread_fn (void *);
56 #endif /* AUDIO_ALSA_H */