Browse SDKs · Android
SDKsAndroid

Create an audio message

Create an audio message from a path relative to the SDK data directory.

Copy
Message message = OpenIMClient.getInstance().messageManager
    .createSoundMessage(soundPath, durationSeconds);

The audio file must be stored under the data directory configured during SDK initialization. Pass its path relative to that directory, and specify the duration in seconds. This method only creates an object waiting to be sent.