libsent/src/adin/adin_mic_linux_alsa.c

マイク入力 (Linux/ALSA) [詳細]

#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <alsa/asoundlib.h>
adin_mic_linux_alsa.cのインクルード依存関係図

ソースコードを見る。

関数

boolean adin_mic_standby (int sfreq, void *dummy)
static int xrun_recovery (snd_pcm_t *handle, int err)
boolean adin_mic_start ()
boolean adin_mic_stop ()
int adin_mic_read (SP16 *buf, int sampnum)
 Read samples from device.

変数

static snd_pcm_t * handle
 Audio handler.
static snd_pcm_hw_params_t * hwparams
 Pointer to device hardware parameters.
static char * pcm_name = "hw:0,0"
 Name of the PCM device.
static boolean need_swap
 Whether samples need byte swap.
static int latency = 50
 Lantency time in msec.
static struct pollfd * ufds
 Poll descriptor.
static int count
 Poll descriptor count.

説明

マイク入力 (Linux/ALSA)

作者:
Akinobu LEE
日付:
Sun Feb 13 16:18:26 2005

ALSA API を使用する,マイク入力のための低レベル関数です. 使用には ALSA サウンドドライバーがインストールされていることが必要です. 使用するには configure 時に "--with-mictype=alsa" を指定して下さい.

サウンドカードが 16bit モノラル で録音できることが必須です.

JuliusはLinuxではミキサーデバイスの設定を一切行いません.録音デバイスの 選択(マイク/ライン)や録音ボリュームの調節は alsamixer など他のツールで 行なって下さい.

複数サウンドカードはサポートされていません.複数のサウンドカードが インストールされている場合,最初の1つが用いられます.

参照:
http://www.alsa-project.org/
Revision
1.3

adin_mic_linux_alsa.c で定義されています。


関数

boolean adin_mic_standby ( int  sfreq,
void *  dummy 
)

Device initialization: check device capability and open for recording.

引数:
sfreq [in] required sampling frequency.
dummy [in] a dummy data
戻り値:
TRUE on success, FALSE on failure.

adin_mic_linux_alsa.c80 行で定義されています。

static int xrun_recovery ( snd_pcm_t *  handle,
int  err 
) [static]

Error recovery when PCM buffer underrun or suspend.

引数:
handle [in] audio handler
err [in] error code
戻り値:
0 on success, otherwise the given errno.

adin_mic_linux_alsa.c270 行で定義されています。

参照元 adin_mic_start().

boolean adin_mic_start (  ) 

Start recording.

戻り値:
TRUE on success, FALSE on failure.

adin_mic_linux_alsa.c296 行で定義されています。

boolean adin_mic_stop (  ) 

Stop recording.

戻り値:
TRUE on success, FALSE on failure.

adin_mic_linux_alsa.c342 行で定義されています。

int adin_mic_read ( SP16 buf,
int  sampnum 
)

Read samples from device.

Read samples from the daemon.

Try to read sampnum samples and returns actual number of recorded samples currently available. This function will block until at least one sample can be obtained.

引数:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
戻り値:
actural number of read samples, -2 if an error occured.

adin_mic_linux_alsa.c360 行で定義されています。


Juliusに対してTue Sep 22 00:14:58 2009に生成されました。  doxygen 1.6.0