IMSDK
IM features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication. It also provides complete app access and backend management APIs.
V2TIMSoundElem

Public Member Functions

void GetUrl (V2TIMValueCallback< V2TIMString > *callback)
 
void DownloadSound (const V2TIMString &path, V2TIMDownloadCallback *callback)
 
void ConvertVoiceToText (const V2TIMString &language, V2TIMValueCallback< V2TIMString > *callback)
 
 V2TIMSoundElem ()
 
 V2TIMSoundElem (const V2TIMSoundElem &)
 
V2TIMSoundElemoperator= (const V2TIMSoundElem &)
 
 ~V2TIMSoundElem () override
 

Data Fields

V2TIMString path
 
V2TIMString uuid
 
uint64_t dataSize
 
uint32_t duration
 
V2TIMElemType elemType
 
void * obj_ptr
 

Constructor & Destructor Documentation

◆ V2TIMSoundElem() [1/2]

◆ V2TIMSoundElem() [2/2]

◆ ~V2TIMSoundElem()

~V2TIMSoundElem ( )
override

Member Function Documentation

◆ GetUrl()

void GetUrl ( V2TIMValueCallback< V2TIMString > *  callback)

Get the voice download URL.

◆ DownloadSound()

void DownloadSound ( const V2TIMString path,
V2TIMDownloadCallback callback 
)

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.

Parameters
pathVoice save path, which must be specified externally

◆ ConvertVoiceToText()

void ConvertVoiceToText ( const V2TIMString language,
V2TIMValueCallback< V2TIMString > *  callback 
)

Convert the voice to text (supported only in 7.4 and later versions).

Parameters
languageRecognition language of voice.
Attention
  • Converting voice to text is a value-added payment feature, and now is in the stage of internal testing. You can join Tencent Cloud IM Group to contact us to activate this feature for you.

◆ operator=()

V2TIMSoundElem& operator= ( const V2TIMSoundElem )

Field Documentation

◆ path

Voice file path(valid only for the message sender)

◆ uuid

Internal ID of the voice message.

◆ dataSize

uint64_t dataSize

Voice file size.

◆ duration

uint32_t duration

Voice duration (seconds)

◆ elemType

V2TIMElemType elemType
inherited

element type

◆ obj_ptr

void* obj_ptr
inherited