#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/adin.h>
#include "pa/portaudio.h"
マクロ定義 | |
#define | MAX_FRAGMENT_MSEC 128 |
Maximum Data fragment Length in msec. | |
関数 | |
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. | |
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 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 |
Stream information |
portaudiooライブラリを使用したマイク入力のための低レベル関数です. 使用するには configure 時に "--with-mictype=portaudio" を指定して下さい. Linux および Win32 で使用可能です.Win32モードではこれが デフォルトとなります.
Juliusはミキサーデバイスの設定を一切行いません.録音デバイスの 選択(マイク/ライン)や録音ボリュームの調節はWindowsの 「ボリュームコントロール」 や Linux の xmixer など,他のツールで 行なって下さい.
portaudio はフリーでクロスプラットホームのオーディオ入出力ライブラリ です.ソースは libsent/src/adin/pa/ に含まれています.このプログラムでは スレッドを利用したcallback を利用して入力音声をリングバッファに取り込んで います.
adin_portaudio.c で定義されています。
#define MAX_FRAGMENT_MSEC 128 |
Maximum Data fragment Length in msec.
Input can be delayed to this time. You can override this value by specifying environment valuable "LATENCY_MSEC".
adin_portaudio.c の 72 行で定義されています。
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 の 94 行で定義されています。
参照元 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_portaudio.c の 160 行で定義されています。
参照元 adin_select().
boolean adin_mic_begin | ( | ) |
Start recording.
adin_portaudio.c の 224 行で定義されています。
参照元 adin_select().
boolean adin_mic_end | ( | ) |
Stop recording.
adin_portaudio.c の 244 行で定義されています。
参照元 adin_select().
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 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 の 271 行で定義されています。
参照元 adin_select().