Api for audio receiving by vn-e4, Audio receiving via http – JVC 4ch Network Encoder VN-E4 User Manual

Page 69

Advertising
background image

69

7. API for Audio Receiving by VN-E4 _

7.1. Audio Receiving via HTTP

This section describes APIs for audio receiving by VN-E4. Make use of the APIs explained in this section in the way as mentioned in Section 4.

1) The client establishes a TCP connection to port number 80 and sends out API.

Refer to Section 4 on details of the Accept and Authorization lines.

The API format when specifying using GET is as follows.

/api/receive?from=network&from.ip=data1&from.protocol=tcp_passive&from.

session_id=data2&from.ip_translate=on&to=audio

Example

/api/receive?from=network&from.ip=10.0.0.100&from.protocol=tcp_passive&frmo.

session_id=12345678&from.ip_translate=on&to=audio

Specify the source IP address for ip=. Specify the client IP number for session_id=. VN-E4 will register this
number and accept the client with the same API (stop). VN-E4 will accept the API at all times when it is
specified as session_id=*.
When from.ip_translate is set to off, VN-E4 will standby to receive audio data from the IP address specified at
from.ip. When from.ip_translate is set to on, VN-E4 will ignore from.ip and standby to receive audio data from
the source IP address of this API.

2) VN-E4 returns a response.

HTTP/1.1 200 OK<CRLF>

Date: Fri, 13 MAY 2005 07:33:12 GMT<CRLF>

Server: VN-E4 API Server/1.0.0<CRLF>

Connection: Keep-Alive<CRLF>

content-type: text/plain<CRLF>

Connection: Keep-Alive<CRLF>

Keep-Alive: timeout=5, max=5<CRLF>

x-vne4_response:

from=network&from.ip=10.0.0.100&from.protocol=tcp_passive&frmo.session_id

=12345678&from.ip_translate=on&to=audio<CRLF><CRLF>

200 OK<CRLF>

The client may disconnect TCP80 at this point of time.

3) The client establishes a TCP connection to port number 49298.

4) The client continues to send 512 bytes of u-Law data with a 12-byte header.

The data's header format is as follows. The 12-byte header is made up of 3 4-byte data.

5) To end, disconnect TCP49298.

Ⅵ Restrictions on Number of Clients

Only 1 client is allowed to send audio data to VN-E4. VN-E4 will return an error for this API and TCP will be
disconnected when this function is currently in use by another client. In addition, VN-E4 will also return an error for this
API and disconnect TCP when there exists a client that makes use of the audio reception feature at VN-E4 via RTP/UDP.

Ⅵ Timing of Data Sending

512 bytes, or in other words, 64 msec of audio data may be sent during each transmission. Send audio data at intervals
as evenly as possible. A part of the data may be lost if audio data exceeding 2 seconds are sent to VN-E4 at one time.

7.1. Audio Receiving via HTTP

7. AP

GET

Space

API Character String

Space

HTTP/1.1

0x0D 0x0A

Accept

Space

text/plain or text/html

0x0D 0x0A

Host:

Space

IP Address of VN-E4

0x0D 0x0A

Authorization: Basic

Space

User Name and Password

0x0D 0x0A 0x0D 0x0A

0x00000080

No. of bytes of audio data (fixed as 512)

Time stamp (Unit: 8 kHz)

512 bytes of u-Law data

Advertising