SDKsReact Native
Create an audio message from a file
OpenIM React Native SDK guide for create an audio message from a file.
Use createSoundMessageFromFullPath() to create a message from an audio file on the device.
const message = await OpenIMSDK.createSoundMessageFromFullPath({
soundPath,
duration: 18,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
soundPath | string | Yes | Full path to the audio file. |
duration | number | Yes | Audio duration in seconds. |
The call returns a MessageItem ready to send. When you use Send a message, the SDK uploads the local audio resource.
Was this page helpful?