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>

ソースコードを見る。

マクロ定義

#define MAXPOLLINTERVAL   300
 Read timeout in msec.

関数

static void output_card_info (char *pcm_name, snd_pcm_t *handle)
 Output detailed device information.
boolean adin_alsa_standby (int sfreq, void *dummy)
 Device initialization: check device capability and open for recording.
static int xrun_recovery (snd_pcm_t *handle, int err)
 Error recovery when PCM buffer underrun or suspend.
boolean adin_alsa_begin ()
 Start recording.
boolean adin_alsa_end ()
 Stop recording.
int adin_alsa_read (SP16 *buf, int sampnum)
 Read samples from device

変数

static snd_pcm_t * handle
 Audio handler
static char * pcm_name = "default"
 Name of the PCM device, can be overridden by env ALSADEV
static int latency = 32
 Lantency time in msec. You can override this value by specifying environment valuable "LATENCY_MSEC".
static boolean need_swap
 Whether samples need byte swap
static struct pollfd * ufds
 Poll descriptor
static int count
 Poll descriptor count


説明

マイク入力 (Linux/ALSA)

ALSA API を使用する,マイク入力のための低レベル関数です. 使用には ALSA サウンドドライバーがインストールされていることが必要です.

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

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

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

バージョン 1.x に対応しています.1.0.13 で動作を確認しました.

デバイス名は "default" が使用されます.環境変数 ALSADEV で変更できます.

参照:
http://www.alsa-project.org/
作者:
Akinobu LEE
日付:
Sun Feb 13 16:18:26 2005
Revision
1.9

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


関数

static void output_card_info ( char *  pcm_name,
snd_pcm_t *  handle 
) [static]

Output detailed device information.

引数:
pcm_name [in] device name string
handle [in] pcm audio handler

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

参照元 adin_alsa_standby().

boolean adin_alsa_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.

< Pointer to device hardware parameters

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

参照元 adin_mic_standby()adin_select().

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.c385 行で定義されています。

参照元 adin_alsa_begin().

boolean adin_alsa_begin (  ) 

Start recording.

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

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

参照元 adin_mic_begin()adin_select().

boolean adin_alsa_end (  ) 

Stop recording.

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

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

参照元 adin_mic_end()adin_select().

int adin_alsa_read ( SP16 buf,
int  sampnum 
)

Read samples from device

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.c483 行で定義されています。

参照元 adin_mic_read()adin_select().


Juliusに対してThu Jul 23 12:17:08 2009に生成されました。  doxygen 1.5.1