VCT_ReceiveAudio

Syntax

#include <vct.h>
BOOL VCT_ReceiveAudio( void* audio_data, u32 length, u32 channel, u8 *aid );

Argument

audio_data A pointer to the buffer.
length Size of the buffer.
channel VCT_ReceiveAudio specifies the number of channels in Conference Mode (0 - 3). This value is ignored in Telephone Mode and Transceiver Mode.
aid AID of the client that is transmitting this streaming. NULL can be also specified.

Return Value

TRUE The audio data was written in a buffer.
FALSE There is no audio data, streaming has not started, or the Library is not initialized.

Description

VCT_ReceiveAudio retrieves audio data from a receiving buffer. Decoded audio data has already been in VCT_HandleData.

The format of the audio_data written in audio_data is 16-bit / 8KHz. This buffer should be aligned at a 4-byte boundary. The audio data length must be 1088 (data for 68ms in 16-bit / 8KHz format). No other value is accepted.

VCT_ReceiveAudio can be called regardless of whether or not the audio streaming has started. If audio streaming has not started, this function clears audio_data to zero.

VCT_ReceiveAudio should be called at intervals of 68ms as often as possible. Interval variations cause an interrupt in audio playback. This function can act as the callback interruption during audio streaming playback.

In Conference Mode, number of times this function must be called is the number of participating players minus one (X - 1 where X is the number of participating players) due to the fact that it retrieves audio data from multiple players. For example, if four players are participating in a conference, VCT_ReceiveAudio is called three times for one audio streaming playback interruption. Since each player receives audio data from the other three participants, the function is called three times. In this example, each channel is assigned a number from zero (0) to two (2).

Using the VCT_ReceiveMixedAudio function instead of VCT_ReceiveAudio enables audio data retrieval after software mixing occurs within the function. This function should be used in cases where using several hardware playback channels in Conference Mode is undesirable.

Specifying the AID allows sending of the stream or remote address retrieval. VCT_ReceiveAudio can adjust stereo channel panning levels for individual participant audio output in either Transceiver Mode or Conference Mode.

This function's return value can be used to determine the existence of audio data to be played. VCT_Receive also enables different processing capabilities, such as BGM mute or volume control during audio playback.

See Also

VCT_Init, VCT_StartStreaming, VCT_SendAudio, VCT_ReceiveMixedAudio

Revision History

2006/04/25 A description regarding VCT_ReceiveMixedAudio was added.
2006/04/13 The transmitting interval was changed from 64ms to 68ms. A note regarding audio_data was modified.
2006/04/06 A description regarding the adjustment of the transmitting interval was modified.
2006/01/25 First release