ドキュメント

サポート

Vivox Core SDK

Vivox Core SDK

Read and alter audio data for each participant

Managing individual participant audio data.
読み終わるまでの所要時間 1 分最終更新 2ヶ月前

The
pf_on_audio_unit_before_recv_audio_mixed
callback provides a parameter with type
vx_before_recv_audio_mixed_participant_data_t *
called
participants_data
. An example of how to use this pointer to access an array of separate participants’ audio data is shown in the code sample below.
If you are upgrading your Vivox integration from v5.10, 5.11, or 5.12 be aware that the unique identifier for participants has changed in v5.13 and later versions. If you were using
participant_display_name
previously you need to change it to
participant_uri
.
void SDKSampleApp::OnBeforeReceivedAudioMixed(const char *session_group_handle, const char *initial_target_uri, vx_before_recv_audio_mixed_participant_data_t *participants_data, size_t num_participants){ std::string example_uri = “example_uri”; // Iterate over the multiple audio streams for (unsigned int i = 0; i < num_participants; i++) { auto &data = participants_data[i]; int channels_per_frame = data.channels_per_frame; std::string participant_uri = data.participant_uri; if (participant_uri == example_uri) { for (unsigned int f = 0; f < data.pcm_frame_count; f++) { for (unsigned int c = 0; c < channels_per_frame; c++) { // Use / modify the audio data. Here we're simply dividing the samples by 2. data.pcm_frames[(f * channels_per_frame) + c] /= 2; } } } }}