Skip to main content
Version: 5.5

Example: Translation room

This page shows how to use subgroups to provide translation services on a group call (conference).

Requirements

The requirements for this example are as follows:

  1. Translators join the group call for the translation service.
  2. All participants speak together.
  3. The volume of the original speaker's audio must be decreased when a translator is translating.

Application design

The application design for this example is as follows:

  1. Create subgroups for languages to translate, Jp for Japanese and En for English.

  2. Translators subscribe to a corresponding language subgroup for translation.

    • T-JP: Translates English to Japanese. Subscribes to Jp.
    • T-EN: Translates Japanese to English. Subscribes to En.
  3. Single-language users choose a language subgroup to listen to by their language.

    • J1, J2: Japanese users. Subscribe to Jp.
    • E1, E2: English users. Subscribe to En.
  4. Set "peerUpdate" to NONE.

    • The subgroup language to be translated is already defined.
  5. Set "videoUpdate" to FALSE.

    • Subgroup video flow is not used.
  6. Audios must be sent and received as shown in the following table and figure.

    Participant typeSend audios toReceive audios from
    TranslatorsSubscribed subgroupMain room
    Single-language usersMain roomSubscribed subgroup and main room

Translation room example general topology

Audio flow

The flow and sequence for audio that requires translation are as follows.

Translation room example audio topology

  1. A Japanese user speaks in Japanese.
  2. All participants (including translators) listen to it.
  3. The translator T-EN translates it in English and the translated English audio is routed to the En subgroup.
  4. Only English users (E1 and E2) listen to the audio.

PlanetKit API flow

The following figure shows a proper subgroup API flow and how to subscribe to each subgroup in order to implement a translation service, with the following prerequisites:

  • All participants have joined the translation room.
  • English speakers (E1, E2) and English translator (T-EN) are ready to use the service.

Translation room example flow for iOS/macOS

The following describes how the participant J2 receives a translation service:

  1. J2 subscribes to the Jp subgroup because J2 uses Japanese.
  2. There is no one sending audio to the Jp subgroup yet, so there is no audio routed to J2.
  3. J2 tags one's own audio stream sent to the main room by calling setTagMyAudioOfMainRoom() with "Jp".
    • This means that the audio stream belongs to the Jp subgroup although it is not changed to be sent to the Jp subgroup.
  4. T-JP changes one's own audio stream to be sent to the Jp subgroup by calling changeMyAudioDestination() with "Jp".
    • T-JP sends audio to the Jp subgroup.
    • T-JP's audio is routed to the Jp subgroup members including J2.
  5. J2 calls setPeersAudioAutoVolumeControl() with "Jp" to listen to Japanese audio when T-JP translates.
    • E1 and E2's audios are sent to the main room.
    • T-JP listens to E1 and E2's audios although they subscribed to a different subgroup.
    • J2 also listens to E1 and E2's audio.
    • T-JP translates E1 and E2's audio into Japanese.
    • T-JP's audio is routed to J2.
    • J2 listens to audio translated by T-JP, along with E1 and E2's audio with decreased volume.