@@ -1262,6 +1262,39 @@ public function connectAudio(string $sessionId, string $token, array $websocketO
12621262 return $ this ->client ->connectAudio ($ sessionId , $ token , $ websocketOptions );
12631263 }
12641264
1265+ /**
1266+ *
1267+ * Use this method to start real-time Live Captions for an OpenTok Session.
1268+ *
1269+ * The maximum allowed duration is 4 hours, after which the audio captioning will stop without any effect on the
1270+ * ongoing OpenTok Session. An event will be posted to your callback URL if provided when starting the captions.
1271+ *
1272+ * Each OpenTok Session supports only one audio captioning session.
1273+ *
1274+ * For more information about the Live Captions feature, see the Live Captions developer guide.
1275+ *
1276+ * @param string $sessionId The session ID of the OpenTok session. The audio from Publishers publishing into
1277+ * this session will be used to generate the captions.
1278+ *
1279+ * @param string $token A valid OpenTok token with role set to Moderator.
1280+ *
1281+ * @param string $languageCode (Optional) The BCP-47 code for a spoken language used on this call. The default
1282+ * value is "en-US". The following language codes are supported: "en-AU" (English, Australia), "en-GB"
1283+ * (English, UK), "es-US" (English, US), "zh-CN” (Chinese, Simplified), "fr-FR" (French), "fr-CA" (French, Canadian),
1284+ * "de-DE" (German), "hi-IN" (Hindi, Indian), "it-IT" (Italian), "ja-JP" (Japanese), "ko-KR" (Korean),
1285+ * "pt-BR" (Portuguese, Brazilian), "th-TH" (Thai).
1286+ *
1287+ * @param int $maxDuration (Optional) The maximum duration for the audio captioning, in seconds. The default value
1288+ * is 14,400 seconds (4 hours), the maximum duration allowed.
1289+ *
1290+ * @param bool $partialCaptions (Optional) Whether to enable this to faster captioning at the cost of some
1291+ * degree of inaccuracies. The default value is true.
1292+ *
1293+ * @param string $statusCallbackUrl (Optional) A publicly reachable URL controlled by the customer and capable
1294+ * of generating the content to be rendered without user intervention. The minimum length of the URL
1295+ * is 15 characters and the maximum length is 2048 characters. For more information,
1296+ * see <a href="https://tokbox.com/developer/guides/live-captions/#live-caption-status-updates">Live Caption status updates.</a>
1297+ */
12651298 public function startCaptions (
12661299 string $ sessionId ,
12671300 string $ token ,
@@ -1281,6 +1314,9 @@ public function startCaptions(
12811314 );
12821315 }
12831316
1317+ /**
1318+ * Use this method to stop live captions for a session.
1319+ */
12841320 public function stopCaptions (string $ captionsId )
12851321 {
12861322 return $ this ->client ->stopCaptions ($ captionsId );
0 commit comments