#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <sys/soundcard.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 | MAXPOLLINTERVAL 300 |
Read timeout in msec. | |
#define | MAX_FRAGMENT_MSEC 50 |
Maximum Data fragment Length in msec. | |
#define | MIN_FRAGMENT_SIZE 256 |
Minimum fragment length in bytes | |
関数 | |
boolean | adin_mic_standby (int sfreq, void *dummy) |
Device initialization: check device capability and open for recording. | |
boolean | adin_mic_begin () |
Start recording. | |
boolean | adin_mic_end () |
Stop recording. | |
int | adin_mic_read (SP16 *buf, int sampnum) |
Read samples from device | |
変数 | |
static int | audio_fd |
Audio descriptor | |
static boolean | need_swap |
Whether samples need byte swap | |
static int | frag_size |
Actual data fragment size | |
static boolean | stereo_rec |
TRUE if stereo recording (use left only) |
マイク入力のための低レベル関数です.インタフェースとして OSS サウンドドライバを使用する場合,このファイルが使用されます. カーネル標準のドライバ,OSS/Linuxのドライバ,および ALSA の OSS互換モードに対応しています.
configure でマイクタイプの自動判別を 行なう場合(デフォルト),Linux ではこのOSS用インタフェースが選択されます. 他のインタフェース (ALSA, esd, portaudio, spAudio等) を使用したい場合は configure 時に "--with-mictype=TYPE" を明示的に指定して下さい.
サウンドカードが 16bit モノラル で録音できることが必須です. ただしLinuxでは,ステレオ録音しかできないデバイスの場合, 左チャンネルのみを入力として取り出して認識することもできます.
JuliusはLinuxではミキサーデバイスの設定を一切行いません.録音デバイスの 選択(マイク/ライン)や録音ボリュームの調節は xmixer など他のツールで 行なって下さい.
デフォルトのデバイス名は "/dev/dsp" です.環境変数 AUDIODEV に デバイス名を指定することで,他のデバイス名を使用できます.
adin_mic_linux_oss.c で定義されています。
#define MAX_FRAGMENT_MSEC 50 |
Maximum Data fragment Length in msec.
Input can be delayed to this time. a maximum of 2^x number smaller than this value will be taken. You can override this value by specifying environment valuable "LATENCY_MSEC".
adin_mic_linux_oss.c の 88 行で定義されています。
参照元 adin_mic_standby().
boolean adin_mic_standby | ( | int | sfreq, | |
void * | dummy | |||
) |
Device initialization: check device capability and open for recording.
Connection initialization: check connectivity and open for recording.
sfreq | [in] required sampling frequency. | |
dummy | [in] a dummy data |
adin_mic_linux_oss.c の 109 行で定義されています。
boolean adin_mic_begin | ( | ) |
boolean adin_mic_end | ( | ) |
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 at most MAXPOLLINTERVAL msec, until at least one sample can be obtained. If no data has been obtained after waiting for MAXPOLLINTERVAL msec, returns 0.
When stereo input, only left channel will be used.
buf | [out] samples obtained in this function | |
sampnum | [in] wanted number of samples to be read |
adin_mic_linux_oss.c の 384 行で定義されています。