startSubtitle method

FutureOr<int> startSubtitle(
  1. ByteRTCSubtitleConfig subtitleConfig
)

@hidden currently not available @detail api @author qiaoxingwang @brief Recognizes or translates the speech of all speakers in the room and converts the results into captions.
When calling this method, you can choose the subtitle mode in the ByteRTCSubtitleMode{@link #ByteRTCSubtitleMode}. If you choose the recognition mode, you will receive the rtcRoom:onSubtitleMessageReceived:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleMessageReceived} callback which contains the transcribed text.
If you choose the translation mode, you will receive two rtcRoom:onSubtitleMessageReceived:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleMessageReceived} callbacks simultaneously, one contains the transcribed text and the other contains the translated text.
After calling this method, you will receive the rtcRoom:onSubtitleStateChanged:errorCode:errorMessage:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleStateChanged:errorCode:errorMessage} to inform you of whether subtitles are on. @param subtitleConfig Subtitle configurations. Refer to ByteRTCSubtitleConfig{@link #ByteRTCSubtitleConfig} for details. @return - 0: Success. - < 0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details. @note - Call this method after joining the room. - You can set your source language to Chinese by calling joinRoom and importing a json formatted string "source_language": "zh" through the parameter of extraInfo, to English by importing "source_language": "en" , and to Japanese by importing "source_language": "ja" . If you don't set the source language, SDK will set the language of your system as the source language. If the language of your system is not Chinese, English or Japanese, SDK will set Chinese as the source language.

Implementation

FutureOr<int> startSubtitle(ByteRTCSubtitleConfig subtitleConfig) async {
  return await nativeCall('startSubtitle:', [subtitleConfig]);
}