Julius 4.2
|
マイク入力 (portaudioライブラリ) [詳細]
マクロ定義 | |
#define | OLDVER |
#define | MAX_FRAGMENT_MSEC 128 |
Define this to choose which audio device to open by querying the device API type in the following order in Windows: | |
関数 | |
static int | Callback (void *inbuf, void *outbuf, unsigned long len, PaTimestamp outTime, void *userdata) |
PortAudio callback to store the incoming speech data into the cycle buffer. | |
boolean | adin_mic_standby (int sfreq, void *dummy) |
Device initialization: check device capability and open for recording. | |
static boolean | adin_mic_open (char *arg) |
Open the portaudio device and check capability of the opening device. | |
boolean | adin_mic_begin (char *arg) |
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 SP16 * | speech |
cycle buffer for incoming speech data | |
static int | current |
writing point | |
static int | processed |
reading point | |
static boolean | buffer_overflowed = FALSE |
TRUE if buffer overflowed. | |
static int | cycle_buffer_len |
length of cycle buffer based on INPUT_DELAY_SEC | |
static PortAudioStream * | stream = NULL |
Stream information. | |
static int | srate |
Required sampling rate. |
マイク入力 (portaudioライブラリ)
portaudiooライブラリを使用したマイク入力のための低レベル関数です. 使用するには configure 時に "--with-mictype=portaudio" を指定して下さい. Linux および Win32 で使用可能です.Win32モードではこれが デフォルトとなります.
録音デバイスは WASAPI -> ASIO -> DirectSound -> MME の順で選択されます。 使用するデバイスを指定したい場合は、環境変数 PORTAUDIO_DEV でデバイス名 (先頭から部分マッチ)を指定するか、PORTAUDIO_DEV_NUM でデバイス番号を 指定してください。使用可能なデバイス名とデバイス番号は起動時に出力されます。
Juliusはミキサーデバイスの設定を一切行いません.録音デバイスの 選択(マイク/ライン)や録音ボリュームの調節はWindowsの 「ボリュームコントロール」 や Linux の xmixer など,他のツールで 行なって下さい.
portaudio はフリーでクロスプラットホームのオーディオ入出力ライブラリ です.ソースは libsent/src/adin/pa/ に含まれています.このプログラムでは スレッドを利用したcallback を利用して入力音声をリングバッファに取り込んで います.
adin_portaudio.c で定義されています。
#define MAX_FRAGMENT_MSEC 128 |
Define this to choose which audio device to open by querying the device API type in the following order in Windows:
WASAPI -> ASIO -> DirectSound -> MME
This will be effective when using portaudio library with multiple Host API support, in which case Pa_OpenDefaultStream() will open the first found one (not the one with the optimal performance)
(not work on OLDVER) Maximum Data fragment Length in msec. Input can be delayed to this time. You can override this value by specifying environment valuable "LATENCY_MSEC".
This is not used in the new V19, it uses default value given by the library. At the new V19, you can force latency by PA_MIN_LATENCY_MSEC instead of LATENCY_MSEC.
adin_portaudio.c の 108 行で定義されています。
参照元 adin_mic_open().
static int Callback | ( | void * | inbuf, |
void * | outbuf, | ||
unsigned long | len, | ||
PaTimestamp | outTime, | ||
void * | userdata | ||
) | [static] |
PortAudio callback to store the incoming speech data into the cycle buffer.
inbuf | [in] portaudio input buffer |
outbuf | [in] portaudio output buffer (not used) |
len | [in] length of above |
outTime | [in] output time (not used) |
userdata | [in] user defined data (not used) |
adin_portaudio.c の 132 行で定義されています。
参照元 adin_mic_open().
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_portaudio.c の 356 行で定義されています。
参照元 adin_select().
static boolean adin_mic_open | ( | char * | arg | ) | [static] |
Open the portaudio device and check capability of the opening device.
arg | [in] argument: if number, use it as device ID |
adin_portaudio.c の 371 行で定義されています。
参照元 adin_mic_begin().
boolean adin_mic_begin | ( | char * | arg | ) |
Start recording.
pathname | [in] path name to open or NULL for default |
adin_portaudio.c の 528 行で定義されています。
参照元 adin_select().
boolean adin_mic_end | ( | ) |
Stop recording.
adin_portaudio.c の 554 行で定義されています。
参照元 adin_select().
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 some samples are obtained.
buf | [out] samples obtained in this function |
sampnum | [in] wanted number of samples to be read |
adin_portaudio.c の 597 行で定義されています。
参照元 adin_select().
char* adin_mic_input_name | ( | ) |
Function to return current input source device name.
adin_portaudio.c の 672 行で定義されています。
参照元 adin_select().