AITranscriberStore provides a complete set of AI real-time transcription management APIs, including starting, updating, and stopping real-time transcription. Through this class, you can implement real-time speech-to-text transcription with multi-language translation support during audio/video calls or live streaming.AITranscriberStore instance for a specific room. Configure the source language and translation languages before starting transcription.Function | Description |
Create an instance for a specific room. | |
Start transcription. | |
Update transcription configuration. | |
Stop transcription. | |
Start interpretation. | |
Update interpretation configuration. | |
Stop interpretation. | |
Set interpretation volume. |
public func startTranscription(myLanguage: SourceLanguage, config: TranscriptionConfig = TranscriptionConfig(), completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
myLanguage | The source language for the current user's speech recognition. | |
config | Transcription configuration, including whether to enable translation. | |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func updateTranscription(myLanguage: SourceLanguage, config: TranscriptionConfig = TranscriptionConfig(), completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
myLanguage | The new source language for speech recognition. | |
config | New transcription configuration. | |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func stopTranscription(completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func startInterpretation(myLanguage: SourceLanguage, config: InterpretationConfig = InterpretationConfig(), completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
myLanguage | The source language for interpretation. | |
config | Interpretation configuration, including voice type. | |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func updateInterpretation(myLanguage: SourceLanguage, config: InterpretationConfig = InterpretationConfig(), completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
myLanguage | The new source language for interpretation. | |
config | New interpretation configuration. | |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func stopInterpretation(completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
completion | CompletionClosure? | Completion callback (success/failure status). |
public func setInterpretationVolume(_ volume: Int, completion: CompletionClosure? = nil) {fatalError("\\(#function) must be overridden by subclass")}
Parameter | Type | Description |
volume | Int | Volume level. |
completion | CompletionClosure? | Completion callback (success/failure status). |
Enum Value | Description |
onReceiveTranscriberMessage | Triggered when a new transcription message is received. |
onRealtimeTranscriberStarted | Triggered when the real-time transcription service has been started successfully. |
onRealtimeTranscriberStopped | Triggered when the real-time transcription service has been stopped. |
onRealtimeTranscriberError | Triggered when an error occurs during real-time transcription. |
Enum Value | Value | Description |
chineseEnglish | zh_en | Chinese-English mixed recognition. |
chinese | zh | Chinese. |
english | en | English. |
cantonese | zh-yue | Cantonese. |
vietnamese | vi | Vietnamese. |
japanese | ja | Japanese. |
korean | ko | Korean. |
indonesian | id | Indonesian. |
thai | th | Thai. |
portuguese | pt | Portuguese. |
turkish | tr | Turkish. |
arabic | ar | Arabic. |
spanish | es | Spanish. |
hindi | hi | Hindi. |
french | fr | French. |
malay | ms | Malay. |
filipino | fil | Filipino. |
german | de | German. |
italian | it | Italian. |
russian | ru | Russian. |
Enum Value | Value | Description |
chinese | zh | Chinese. |
english | en | English. |
vietnamese | vi | Vietnamese. |
japanese | ja | Japanese. |
korean | ko | Korean. |
indonesian | id | Indonesian. |
thai | th | Thai. |
portuguese | pt | Portuguese. |
arabic | ar | Arabic. |
spanish | es | Spanish. |
french | fr | French. |
malay | ms | Malay. |
german | de | German. |
italian | it | Italian. |
russian | ru | Russian. |
Enum Value | Value | Description |
female | female | Female voice. |
male | male | Male voice. |
Property | Type | Description |
segmentId | String | Unique identifier of the transcription segment. |
speakerUserId | String | User ID of the speaker. |
speakerUserName | String | Display name of the speaker. |
sourceText | String | Original transcribed text from the speech recognition. |
translationTexts | [TranslationLanguage: String] | Translation results, keyed by target language. Contains translation texts for each configured translation language. |
timestamp | Int64 | Timestamp of the message. |
isCompleted | Bool | Whether the segment transcription is completed. When true, the source text and translation texts will no longer be updated. |
Property | Type | Description |
enableTranslation | Bool | Whether to enable translation during transcription. |
Property | Type | Description |
voice | Voice type for interpretation output. |
Property | Type | Description |
sourceLanguage | Source language for speech recognition, defaults to Chinese-English mixed. | |
translationLanguages | List of target languages for translation. Multiple languages can be configured simultaneously. |
Property | Type | Description |
selfLanguage | Current user's self language. | |
realtimeMessageList | List of real-time transcription messages, updated automatically as transcription progresses. | |
isTranscriptionRunning | Bool | Whether transcription is currently running. |
transcriptionConfig | Current transcription configuration. | |
isInterpretationRunning | Bool | Whether interpretation is currently running. |
interpretationConfig | Current interpretation configuration. | |
interpretationVolume | Int | Current interpretation volume level. |
// Create instance for a specific roomlet store = AITranscriberStore.create(roomID: "your_room_id")// Subscribe to state changesstore.state.subscribe { state infor message in state.realtimeMessageList {print("Speaker: \\(message.speakerUserName)")print("Source text: \\(message.sourceText)")}}// Configure transcriptionvar config = TranscriberConfig()config.sourceLanguage = .chineseEnglishconfig.translationLanguages = [.english, .japanese]// Start transcriptionstore.startRealtimeTranscriber(config: config) { error inif let error = error {print("Start failed: \\(error)")}}
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários