59 #ifndef __AUDIO_TINYALSA_H 60 #define __AUDIO_TINYALSA_H 65 #if defined(__cplusplus) 74 #define PCM_OUT 0x00000000 81 #define PCM_IN 0x10000000 87 #define PCM_MMAP 0x00000001 94 #define PCM_NOIRQ 0x00000002 107 #define PCM_NORESTART 0x00000004 113 #define PCM_MONOTONIC 0x00000008 119 #define PCM_STATE_RUNNING 0x03 124 #define PCM_STATE_XRUN 0x04 129 #define PCM_STATE_DRAINING 0x05 134 #define PCM_STATE_SUSPENDED 0x07 139 #define PCM_STATE_DISCONNECTED 0x08 182 unsigned int bits[32 /
sizeof(
unsigned int)];
236 PCM_PARAM_PERIOD_TIME,
243 PCM_PARAM_BUFFER_TIME,
244 PCM_PARAM_BUFFER_SIZE,
245 PCM_PARAM_BUFFER_BYTES,
262 struct pcm *
pcm_open(
unsigned int card,
unsigned int device,
unsigned int flags,
const struct pcm_config *config);
408 int pcm_writei(
struct pcm *pcm,
const void *data,
unsigned int frame_count);
420 int pcm_readi(
struct pcm *pcm,
void *data,
unsigned int frame_count);
442 #if defined(__cplusplus) int pcm_writei(struct pcm *pcm, const void *data, unsigned int frame_count)
Writes audio samples to PCM.
struct pcm * pcm_open(unsigned int card, unsigned int device, unsigned int flags, const struct pcm_config *config)
Opens a PCM for playback or recording.
unsigned int pcm_get_channels(const struct pcm *pcm)
Gets the channel count of the PCM.
const char * pcm_get_error(const struct pcm *pcm)
Gets the error message for the last error that occured.
unsigned int pcm_format_to_bits(enum pcm_format format)
Determines the number of bits occupied by a pcm_format.
const struct pcm_config * pcm_get_config(const struct pcm *pcm)
Gets the PCM configuration.
unsigned int stop_threshold
enum pcm_format pcm_get_format(const struct pcm *pcm)
Gets the format of the PCM.
Encapsulates the hardware and software parameters of a PCM.
A bit mask of 256 bits (32 bytes) that describes some hardware parameters of a PCM.
unsigned int pcm_get_buffer_size(const struct pcm *pcm)
Gets the buffer size of the PCM.
unsigned int bits[32/sizeof(unsigned int)]
int pcm_readi(struct pcm *pcm, void *data, unsigned int frame_count)
Reads audio samples from PCM.
pcm_format
Audio sample format of a PCM.
unsigned int start_threshold
int pcm_close(struct pcm *pcm)
Closes a PCM returned by pcm_open.
int pcm_prepare(struct pcm *pcm)
Prepares a PCM, if it has not been prepared already.
unsigned int silence_threshold
int pcm_get_file_descriptor(const struct pcm *pcm)
Gets the file descriptor of the PCM.
struct pcm * pcm_open_by_name(const char *name, unsigned int flags, const struct pcm_config *config)
Opens a PCM by it's name.
int pcm_is_ready(const struct pcm *pcm)
Checks if a PCM file has been opened without error.
unsigned int pcm_frames_to_bytes(const struct pcm *pcm, unsigned int frames)
Determines how many bytes are occupied by a number of frames of a PCM.
unsigned int pcm_get_rate(const struct pcm *pcm)
Gets the sample rate of the PCM.
unsigned int pcm_bytes_to_frames(const struct pcm *pcm, unsigned int bytes)
Determines how many frames of a PCM can fit into a number of bytes.
pcm_param
Enumeration of a PCM's hardware parameters.
unsigned int pcm_get_subdevice(const struct pcm *pcm)
Gets the subdevice on which the pcm has been opened.
unsigned int period_count