Julius 4.2
|
マイク入力 (Sun4) [詳細]
#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <stropts.h>
#include <poll.h>
#include <multimedia/libaudio.h>
#include <multimedia/audio_device.h>
マクロ定義 | |
#define | J_DEF_VOLUME 20 |
Recording volume (range=0-99) | |
#define | DEFAULT_DEVICE "/dev/audio" |
Default device name, can be overridden by AUDIODEV environment variable. | |
関数 | |
boolean | adin_mic_standby (int sfreq, void *dummy) |
Device initialization: check device capability and open for recording. | |
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 | volume = J_DEF_VOLUME |
Default volume. | |
static int | srate |
Required sampling rate. | |
static int | afd |
Audio file descriptor. | |
static struct pollfd | pfd |
File descriptor for polling. | |
static audio_info_t | ainfo |
Audio info. | |
static char * | defaultdev = DEFAULT_DEVICE |
static char | devname [MAXPATHLEN] |
マイク入力 (Sun4)
SunOS 4.x でマイク入力を使用するための低レベル音声入力関数です. SunOS 4.x のマシンではデフォルトでこのファイルが使用されます.
Sun SunOS 4.1.3 で動作確認をしています.Solaris2.x については adin_mic_sol2.c を御覧下さい.
起動後オーディオ入力はマイクに自動的に切り替わり,ボリュームは J_DEF_VOLUME の値に設定されます.
デフォルトのデバイス名は "/dev/audio" です.環境変数 AUDIODEV に デバイス名を指定することで,他のデバイス名を使用できます.
adin_mic_sun4.c で定義されています。
boolean adin_mic_standby | ( | int | sfreq, |
void * | dummy | ||
) |
Device initialization: check device capability and open for recording.
Device initialization: check machine capability.
sfreq | [in] required sampling frequency. |
dummy | [in] a dummy data |
adin_mic_sun4.c の 83 行で定義されています。
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_sun4.c の 98 行で定義されています。
参照元 adin_mic_begin().
boolean adin_mic_begin | ( | char * | pathname | ) |
Start recording.
pathname | [in] path name to open or NULL for default |
adin_mic_sun4.c の 171 行で定義されています。
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_sun4.c の 234 行で定義されています。
char* adin_mic_input_name | ( | ) |
Function to return current input source device name.
adin_mic_sun4.c の 268 行で定義されています。