SphinxBase  5prealpha
ad.h File Reference

generic live audio interface for recording and playback More...

#include <sphinx_config.h>
#include <sphinxbase/sphinxbase_export.h>
#include <sphinxbase/prim_type.h>

Go to the source code of this file.

Macros

#define DEFAULT_SAMPLES_PER_SEC   16000
 
#define AD_OK   0
 
#define AD_EOF   -1
 
#define AD_ERR_GEN   -1
 
#define AD_ERR_NOT_OPEN   -2
 
#define AD_ERR_WAVE   -3
 

Typedefs

typedef struct ad_rec_s ad_rec_t
 

Functions

SPHINXBASE_EXPORT ad_rec_tad_open_dev (const char *dev, int32 samples_per_sec)
 Open a specific audio device for recording. More...
 
SPHINXBASE_EXPORT ad_rec_tad_open_sps (int32 samples_per_sec)
 Open the default audio device with a given sampling rate. More...
 
SPHINXBASE_EXPORT ad_rec_tad_open (void)
 Open the default audio device.
 
SPHINXBASE_EXPORT int32 ad_start_rec (ad_rec_t *)
 
SPHINXBASE_EXPORT int32 ad_stop_rec (ad_rec_t *)
 
SPHINXBASE_EXPORT int32 ad_close (ad_rec_t *)
 
SPHINXBASE_EXPORT int32 ad_read (ad_rec_t *, int16 *buf, int32 max)
 

Detailed Description

generic live audio interface for recording and playback

Definition in file ad.h.

Function Documentation

SPHINXBASE_EXPORT ad_rec_t* ad_open_dev ( const char *  dev,
int32  samples_per_sec 
)

Open a specific audio device for recording.

The device is opened in non-blocking mode and placed in idle state.

Returns
pointer to read-only ad_rec_t structure if successful, NULL otherwise. The return value to be used as the first argument to other recording functions.
Parameters
devDevice name (platform-specific)
samples_per_secSamples per second

Definition at line 187 of file ad_alsa.c.

Referenced by ad_open_sps().

SPHINXBASE_EXPORT ad_rec_t* ad_open_sps ( int32  samples_per_sec)

Open the default audio device with a given sampling rate.

Parameters
samples_per_secSamples per second

Definition at line 222 of file ad_alsa.c.

References ad_open_dev().

Referenced by ad_open().