Julius 4.2
関数 | 変数
libsent/src/adin/adin_tcpip.c

ネットワーク入力:adinnet クライアントからの音声入力 [詳細]

#include <sent/stddefs.h>
#include <sent/adin.h>
#include <sent/tcpip.h>

ソースコードを見る。

関数

boolean adin_tcpip_standby (int freq, void *port_str)
 Initialize as adinnet server: prepare to become server.
boolean adin_tcpip_begin (char *pathname)
 Wait for connection from adinnet client and begin audio input stream.
boolean adin_tcpip_end ()
 End recording.
int adin_tcpip_read (SP16 *buf, int sampnum)
 Try to read sampnum samples and returns actual sample num recorded.
boolean adin_tcpip_send_pause ()
 Tell the adinnet client to pause transfer.
boolean adin_tcpip_send_resume ()
 Tell the adinnet client to resume the paused transfer.
boolean adin_tcpip_send_terminate ()
 Tell the adinnet client to terminate transfer.
char * adin_tcpip_input_name ()
 Function to return current input source device name.

変数

static int adinnet_sd = -1
 Listen socket for adinserv.
static int adinnet_asd = -1
 Accept socket for adinserv.

説明

ネットワーク入力:adinnet クライアントからの音声入力

入力ソースとして Julius の adinnet クライアントを使用する低レベル関数です.

adinnet は ネットワーク上で音声データを送信する Julius 独自の方式です. この入力が選ばれた場合,Julius はadinnetサーバとなり,起動時に クライアントの接続を待ちます.サンプルのadinnetクライアントとして, adintool が Julius に付属していますので参考にしてください.

Linux, Windows, その他サポートされているほとんどの OS で動作します.

他にネットワーク上で音声データをやりとりする方法として, Linux では EsounD を使う方法があります.adin_esd.c をご覧ください.

注意:
サーバ側とクライアント側でサンプリングレート の設定を一致させる必要があります.接続時に両者間でチェックは行われません.
バグ:
マシンバイトオーダーの異なるマシン同士で正しく通信できません.
作者:
Akinobu LEE
日付:
Mon Feb 14 14:55:03 2005
Revision:
1.6

adin_tcpip.c で定義されています。


関数

boolean adin_tcpip_standby ( int  freq,
void *  port_str 
)

Initialize as adinnet server: prepare to become server.

引数:
freq[in] required sampling frequency
port_str[in] port number in string
戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c78 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_begin ( char *  pathname)

Wait for connection from adinnet client and begin audio input stream.

引数:
pathname[in] path name to open or NULL for default
戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c102 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_end ( )

End recording.

If last input segment was segmented by end of connection, close socket and wait for next connection. Otherwise, it means that the last input segment was segmented by either end-of-segment signal from client side or speech detection function in server side, so just wait for a next input in the current socket.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c151 行で定義されています。

参照元 adin_select().

int adin_tcpip_read ( SP16 buf,
int  sampnum 
)

Try to read sampnum samples and returns actual sample num recorded.

This function will not block.

If data of zero length has been received, it is treated as a end-of-segment marker from the client. If data below zero length has been received, it means the client has finished the overall input stream transmission and want to disconnect.

引数:
buf[out] samples obtained in this function
sampnum[in] wanted number of samples to be read
戻り値:
actural number of read samples, -1 if EOF, -2 if error.

adin_tcpip.c182 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_send_pause ( )

Tell the adinnet client to pause transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c226 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_send_resume ( )

Tell the adinnet client to resume the paused transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c244 行で定義されています。

参照元 adin_select().

boolean adin_tcpip_send_terminate ( )

Tell the adinnet client to terminate transfer.

戻り値:
TRUE on success, FALSE on failure.

adin_tcpip.c292 行で定義されています。

参照元 adin_select().

char* adin_tcpip_input_name ( )

Function to return current input source device name.

戻り値:
string of current input device name.

adin_tcpip.c312 行で定義されています。

参照元 adin_select().