Sending is performed by the VCT_Main
function. By calling the VCT_Main
function, the send callback set in VCTConfig
gets called when voice data needs to be sent. Use the communication library's send function (which in the case of the Pia library is nn::pia::transport::UnreliableProtocol::Send
) inside the application's send callback to send the audio data.
The sending process inside VCT_Main
(that is, the call to the send callback) must be run a sufficient number of times, so you also must call VCT_Main
a sufficient number of times.
Given an audio frame length of length ms and the need to send to num number of peers, you must call the function at least (num * 1000 / length) times in one second. For example, if the audio frame length is 144 ms and there are 8 connected systems, the calculation is 7 * 1000 / 144 = 48.6. You would need to call the function about 50 to 60 times per second.
Because audio processing is conducted on a periodic basis, call the function periodically if at all possible, rather than in spurts. For example, call the function the necessary number of times in each game frame.