以下程序是可以正常运行的:
#include <alsa/asoundlib.h>
#include <math.h>
#include <pthread.h>
#include <string.h>
#define BUFFERSIZE 4096
#define PERIOD_SIZE 1024
#define PERIODS 2
#define SAMPLE_RATE 16000
#define CHANNELS 1
#define FSIZE 2*CHANNELS
/* Use the newer ALSA API */
#define ALSA_PCM_NEW_HW_PARAMS_API
#include <alsa/asoundlib.h>