sound_pcm.h 文件参考
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <aos/list.h>
#include <aos/kernel.h>
#include <sys/ioctl.h>
#include "audio_drv.h"

浏览源代码.

结构体

struct  aos_pcm_hw_params_t
 
struct  aos_pcm_sw_params_t
 
struct  aos_pcm_t
 
struct  hint_list_t
 

宏定义

#define AOS_PCM_BLOCK   0x00000000
 
#define AOS_PCM_NONBLOCK   0x00000001
 
#define AOS_PCM_ASYNC   0x00000002
 
#define AOS_PCM_ABORT   0x00008000
 
#define AOS_PCM_NO_AUTO_RESAMPLE   0x00010000
 
#define AOS_PCM_NO_AUTO_CHANNELS   0x00020000
 
#define AOS_PCM_NO_AUTO_FORMAT   0x00040000
 
#define AOS_PCM_NO_SOFTVOL   0x00080000
 
#define AOS_PCM_EVT_WRITE   (1 << 0)
 
#define AOS_PCM_EVT_READ   (1 << 1)
 
#define AOS_PCM_EVT_XRUN   (1 << 2)
 

类型定义

typedef unsigned long aos_pcm_uframes_t
 
typedef signed long aos_pcm_sframes_t
 

枚举

enum  aos_pcm_stream_t { AOS_PCM_STREAM_PLAYBACK = 0 , AOS_PCM_STREAM_CAPTURE , AOS_PCM_STREAM_LAST = AOS_PCM_STREAM_CAPTURE }
 
enum  aos_pcm_state_t {
  AOS_PCM_STATE_IDLE = 0 , AOS_PCM_STATE_OPEN , AOS_PCM_STATE_PREPARED , AOS_PCM_STATE_RUNNING ,
  AOS_PCM_STATE_XRUN , AOS_PCM_STATE_DRAINING , AOS_PCM_STATE_PAUSED , AOS_PCM_STATE_SUSPENDED ,
  AOS_PCM_STATE_DISCONNECTED , AOS_PCM_STATE_LAST = AOS_PCM_STATE_DISCONNECTED , AOS_PCM_STATE_PRIVATE1 = 1024
}
 
enum  aos_pcm_format_t {
  AOSRV_PCM_FORMAT_S8 = 1 , AOSRV_PCM_FORMAT_S16_LE = 2 , AOSRV_PCM_FORMAT_S24_LE = 3 , AOSRV_PCM_FORMAT_S32_LE = 4 ,
  AOSRV_PCM_FORMAT_ALL
}
 
enum  aos_pcm_access_t { AOS_PCM_ACCESS_MMAP_INTERLEAVED = 0 , AOS_PCM_ACCESS_MMAP_NONINTERLEAVED , AOS_PCM_ACCESS_RW_INTERLEAVED , AOS_PCM_ACCESS_RW_NONINTERLEAVED }
 

函数

int aos_device_name_hint (int card, void *hints)
 
int aos_pcm_open (aos_pcm_t **pcm, const char *name, aos_pcm_stream_t stream, int mode)
 
int aos_pcm_prepare (aos_pcm_t *pcm)
 
int aos_pcm_start (aos_pcm_t *pcm)
 
int aos_pcm_wait (aos_pcm_t *pcm, int timeout)
 
int aos_pcm_stop (aos_pcm_t *pcm)
 
int aos_pcm_drain (aos_pcm_t *pcm)
 
int aos_pcm_pause (aos_pcm_t *pcm, int enable)
 
int aos_pcm_close (aos_pcm_t *pcm)
 
int aos_pcm_recover (aos_pcm_t *pcm)
 
int aos_pcm_hw_params_alloca (aos_pcm_hw_params_t **p)
 
int aos_pcm_hw_params_any (aos_pcm_hw_params_t *params)
 
int aos_pcm_hw_params (aos_pcm_t *pcm, aos_pcm_hw_params_t *p)
 
int aos_pcm_set_params (aos_pcm_t *pcm, aos_pcm_format_t format, aos_pcm_access_t access, unsigned int channels, unsigned int rate, int soft_resample, unsigned int latency)
 
int aos_pcm_sw_params_alloca (aos_pcm_sw_params_t **p)
 
int aos_pcm_sw_params_any (aos_pcm_sw_params_t *params)
 
int aos_pcm_sw_params (aos_pcm_t *pcm, aos_pcm_sw_params_t *params)
 
aos_pcm_sframes_t aos_pcm_writei (aos_pcm_t *pcm, const void *buffer, aos_pcm_uframes_t size)
 
aos_pcm_sframes_t aos_pcm_readi (aos_pcm_t *pcm, void *buffer, aos_pcm_uframes_t size)
 
aos_pcm_sframes_t aos_pcm_writen (aos_pcm_t *pcm, void **bufs, aos_pcm_uframes_t size)
 
aos_pcm_sframes_t aos_pcm_readn (aos_pcm_t *pcm, void **bufs, aos_pcm_uframes_t size)
 
int aos_pcm_suspend (aos_pcm_t *pcm)
 
int aos_pcm_resume (aos_pcm_t *pcm)
 
aos_pcm_sframes_t aos_pcm_bytes_to_frames (aos_pcm_t *pcm, int bytes)
 
int aos_pcm_frames_to_bytes (aos_pcm_t *pcm, aos_pcm_sframes_t frames)