/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See the file COPYING * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2017 Frank van Maarseveen */ #ifndef _ALSA_H_ #define _ALSA_H_ #include "common.h" #define PLAY_RATE 48000 #define PLAY_CHANNELS 2 #define PLAY_BYTES 2 #define PLAY_FRAMESIZE (PLAY_CHANNELS * PLAY_BYTES) #define PLAY_CHUNKSIZE 350 #define PLAY_CHUNKBYTES (PLAY_CHUNKSIZE * PLAY_FRAMESIZE) // 1400 bytes #define PLAY_NVOL 4 struct play_param { const char * volume; int bufferframes; }; void alsa_open(const char *device, const struct play_param *p); void alsa_volume(uint16_t vol); void alsa_write(const void *chunk, int size); void alsa_resync(void); int alsa_syncadj(void); void alsa_suspend(void); void alsa_resume(void); void alsa_close(void); #endif