Skip to main content

createSoundMessageByURL

Feature Introduction

Note

When you need to store resources yourself, create a voice message to send to the other party after uploading the voice through the API and obtaining the download address.

Caution

Messages created by this API must be sent via sendMessageNotOss.

Function Prototype


+ (OIMMessageInfo *)createSoundMessageByURL:(NSString *)fileURL
duration:(NSInteger)duration
size:(NSInteger)size;

Input Parameters

Parameter NameParameter TypeMandatoryDescription
fileURLNSStringYesAudio URL
durationNSIntegerYesDuration
sizeNSIntegerYesFile Size

Return Value

NameTypeDescription
messageOIMMessageInfoSuccessful Return

Code Sample


OIMMessageInfo *message = [OIMMessageInfo createSoundMessageByURL:@"" duration:1 size:1024];