Browse SDKs · uni-app / uni-app x
SDKsuni-app

Create an audio message from a file

OpenIM uni-app / uni-app x SDK guide for Create an audio message from a file.

Copy
import { createSoundMessageFromFullPath } from '@/uni_modules/unix-openim-sdk'

const message = await createSoundMessageFromFullPath({ soundPath: '/data/user/0/app/cache/voice.m4a', duration: 8 })

Commercial createSoundMessage() uses the structured form. Wait until recording is closed and readable; make duration match the actual media and the contract unit.