Julius 4.2
|
マイク入力 (FreeBSD) [詳細]
#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <poll.h>
マクロ定義 | |
#define | DEFAULT_DEVICE "/dev/dsp" |
Default device name, can be overridden by AUDIODEV environment variable. | |
#define | FREQALLOWRANGE 200 |
Acceptable width of sampling frequency. | |
#define | POLLINTERVAL 200 |
Polling interval in miliseconds. | |
関数 | |
boolean | adin_mic_standby (int sfreq, void *arg) |
Device initialization: check machine capability. | |
static boolean | adin_mic_open (char *devstr) |
Open the specified device and check capability of the opening device. | |
boolean | adin_mic_begin (char *pathname) |
Start recording. | |
boolean | adin_mic_end () |
Stop recording. | |
int | adin_mic_read (SP16 *buf, int sampnum) |
Read samples from device. | |
char * | adin_mic_input_name () |
Function to return current input source device name. | |
変数 | |
static int | srate |
Required sampling rate. | |
static int | audio_fd |
Audio descriptor. | |
static boolean | need_swap |
Whether input samples need byte-swapping. | |
struct pollfd | fds [1] |
Workarea for polling device. | |
static char * | defaultdev = DEFAULT_DEVICE |
Default device name. | |
static char | devname [MAXPATHLEN] |
Current device name. |
マイク入力 (FreeBSD)
マイク入力のための低レベル関数です.FreeBSDでこのファイルが使用されます.
サウンドカードが 16bit モノラル で録音できることが必須です.
JuliusはFreeBSDでミキサーデバイスの設定を一切行いません.録音デバイスの 選択(マイク/ライン)や録音ボリュームの調節は他のツールで 行なって下さい.
デフォルトのデバイス名は "/dev/dsp" です.環境変数 AUDIODEV に デバイス名を指定することで,他のデバイス名を使用できます.
動作確認はFreeBSD 3.2-RELEASE で行なわれました.サウンドドライバは snd を使用しています.
adin_mic_freebsd.c で定義されています。
boolean adin_mic_standby | ( | int | sfreq, |
void * | arg | ||
) |
Device initialization: check machine capability.
sfreq | [in] required sampling frequency. |
arg | [in] a dummy data |
adin_mic_freebsd.c の 94 行で定義されています。
static boolean adin_mic_open | ( | char * | devstr | ) | [static] |
Open the specified device and check capability of the opening device.
devstr | [in] device string to open |
adin_mic_freebsd.c の 109 行で定義されています。
参照元 adin_mic_begin().
boolean adin_mic_begin | ( | char * | pathname | ) |
Start recording.
pathname | [in] path name to open or NULL for default |
adin_mic_freebsd.c の 212 行で定義されています。
boolean adin_mic_end | ( | ) |
int adin_mic_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 |
adin_mic_freebsd.c の 255 行で定義されています。
char* adin_mic_input_name | ( | ) |
Function to return current input source device name.
adin_mic_freebsd.c の 289 行で定義されています。