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>

Go to the source code of this file.

Functions

boolean adin_tcpip_standby (int freq, void *port_str)
 Initialize as adinnet server: prepare to become server.
boolean adin_tcpip_begin ()
 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.

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.

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.
Author:
Akinobu LEE
Date:
Mon Feb 14 14:55:03 2005
Revision
1.1.1.1

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 79 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 103 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 156 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 188 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 234 of file adin_tcpip.c.

Referenced by j_request_pause().

boolean adin_tcpip_send_resume (  ) 

Tell the adinnet client to resume the paused transfer.

Returns:
TRUE on success, FALSE on failure.

Definition at line 252 of file adin_tcpip.c.

Referenced by j_request_resume().

boolean adin_tcpip_send_terminate (  ) 

Tell the adinnet client to terminate transfer.

Returns:
TRUE on success, FALSE on failure.

Definition at line 270 of file adin_tcpip.c.

Referenced by j_request_terminate().


Generated on Tue Dec 18 16:01:37 2007 for Julius by  doxygen 1.5.4