libsent/src/adin/adin_tcpip.c File Reference

Audio input from adinnet client. More...

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

Include dependency graph for adin_tcpip.c:

Go to the source code of this file.

Functions

boolean adin_tcpip_standby (int freq, void *port_str)
boolean adin_tcpip_begin ()
boolean adin_tcpip_end ()
 End recording.
int adin_tcpip_read (SP16 *buf, int sampnum)
boolean adin_tcpip_send_pause ()
boolean adin_tcpip_send_resume ()
boolean adin_tcpip_send_terminate ()

Variables

static int adinnet_sd = -1
 Listen socket for adinserv.
static int adinnet_asd = -1
 Accept socket for adinserv.
static boolean last_is_segmented = FALSE
 FALSE if last segment was an end of connection.


Detailed Description

Audio input from adinnet client.

Author:
Akinobu LEE
Date:
Mon Feb 14 14:55:03 2005
Low level I/O functions for audio input from adinnet client. The adinnet server/client is a scheme to transfer speech data via tcp/ip network with segmentation information, implemented for Julius. When this input is selected, Julius becomes adinnet server and wait for a client to connect. The sample client "adintool" is also included in Julius package.

This input works on Linux, Windows and most OS where Julius can run.

"EsounD" is an another method of obtaining audio input from network on Linux. See adin_esd.c for details.

Attention:
The sampling rate setting on both side (server and client) should be the same. They will not be checked when connected.
Bug:
Does not work between different machine byte order.
Revision
1.4

Definition in file adin_tcpip.c.


Function Documentation

boolean adin_tcpip_standby ( int  freq,
void *  port_str 
)

Initialize as adinnet server: prepare to become server.

Parameters:
freq [in] required sampling frequency
port_str [in] port number in string
Returns:
TRUE on success, FALSE on failure.

Definition at line 78 of file adin_tcpip.c.

Referenced by adin_select().

boolean adin_tcpip_begin (  ) 

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

Returns:
TRUE on success, FALSE on failure.

Definition at line 100 of file adin_tcpip.c.

Referenced by 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.

Returns:
TRUE on success, FALSE on failure.

Definition at line 146 of file adin_tcpip.c.

Referenced by 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.

Parameters:
buf [out] samples obtained in this function
sampnum [in] wanted number of samples to be read
Returns:
actural number of read samples, -1 if EOF, -2 if error.

Definition at line 177 of file adin_tcpip.c.

Referenced by adin_select().

boolean adin_tcpip_send_pause (  ) 

Tell the adinnet client to pause transfer.

Returns:
TRUE on success, FALSE on failure.

Definition at line 223 of file adin_tcpip.c.

Referenced by msock_exec_command().

boolean adin_tcpip_send_resume (  ) 

Tell the adinnet client to resume the paused transfer.

Returns:
TRUE on success, FALSE on failure.

Definition at line 240 of file adin_tcpip.c.

Referenced by msock_exec_command().

boolean adin_tcpip_send_terminate (  ) 

Tell the adinnet client to terminate transfer.

Returns:
TRUE on success, FALSE on failure.

Definition at line 257 of file adin_tcpip.c.

Referenced by msock_exec_command().


Generated on Tue Dec 26 16:17:41 2006 for Julius by  doxygen 1.5.0