Instance Methods | |
(void) | - getUrl: |
(void) | - downloadSound:progress:succ:fail: |
(void) | - convertVoiceToText:completion: |
(V2TIMElem *) | - nextElem |
(void) | - appendElem: |
Properties | |
NSString * | path |
NSString * | uuid |
int | dataSize |
int | duration |
- (void) getUrl: | (void(^)(NSString *url)) | urlCallBack |
Get the voice download URL.
- (void) downloadSound: | (NSString *) | path | |
progress: | (V2TIMDownLoadProgress) | progress | |
succ: | (V2TIMSucc) | succ | |
fail: | (V2TIMFail) | fail | |
Download voice
The downloadSound API downloads files from the server each time. If cache or storage is required, you can use UUIDs as keys for external storage. The IM SDK does not store resource files.
path | Voice save path, which must be specified externally |
- (void) convertVoiceToText: | (NSString *) | language | |
completion: | (void(^)(int code, NSString *desc, NSString *result)) | callback | |
Convert the voice to text (supported only in 7.4 and later versions).
language | Recognition language of voice. |
- (V2TIMElem *) nextElem |
Get the next Elem. If your message has multiple Elems, you can get the next Elem object from the current Elem. If the return value is nil, it means the Elem acquisition is over. For detailed usage, please refer to the document Message sending and receiving
- (void) appendElem: | (V2TIMElem *) | elem |
Add the next element
To configure multiple elements, you can add the next element via the element of a Message object after creating the Message object. The following is the sample code for creating V2TIMTextElem and V2TIMCustomElem elements:
V2TIMMessage *msg = [[V2TIMManager sharedInstance] createTextMessage:"text"]; V2TIMCustomElem *customElem = [[V2TIMCustomElem alloc] init]; customElem.data = ["自定义消息" dataUsingEncoding:NSUTF8StringEncoding]; [msg.textElem appendElem:customElem];
|
readnonatomicstrong |
Voice file path(valid only for the message sender)
|
readnonatomicstrong |
Internal ID of the voice message.
|
readnonatomicassign |
Voice file size.
|
readnonatomicassign |
Voice duration (seconds)