SDKsReact NativeEnterprise
Save local transcript
Save speech-to-text transcription results to a local voice message on the current device using the OpenIM React Native SDK.
Persist audio transcription text to a locally stored voice message on the current device:
Pass the updated full MessageItem object while preserving all existing properties.
const updatedMessage = {
...message,
soundElem: {
...message.soundElem,
text: {
text: transcript,
translate: message.soundElem?.text?.translate ?? {},
},
},
};
await OpenIMSDK.setMessageLocalContent({
conversationID,
message: updatedMessage,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation ID. |
message | MessageItem | Yes | Complete message object incorporating the updated transcription text. |
Return value
A resolved Promise confirms that the transcription text was successfully saved to the local SQLite database on the current device.
This modification is stored strictly on the local client; it is not synchronized to remote servers and does not trigger multi-device sync events. Reconcile the UI view by updating the message bubble keyed by clientMsgID within the scope of the corresponding conversationID.
Was this page helpful?