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 audio. This API downloads data from the server. To cache or store the data, you can use the UUID as the key. The Chat SDK does not store the files.

Parameters
pathThe path to which the audio file is saved. It 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
languageThe language of the voice recognized.
Attention
  • Converting voice to text is a paid value-added feature and is now in beta testing. To try the feature, join our Tencent Cloud IM Group.

◆ operator=()

V2TIMSoundElem& operator= ( const V2TIMSoundElem )

Field Documentation

◆ path

The path of the audio file to be sent (can only be called by the message sender)

◆ uuid

The internal ID of a voice message.

◆ dataSize

uint64_t dataSize

The voice data size.

◆ duration

uint32_t duration

The voice duration (seconds)

◆ elemType

V2TIMElemType elemType
inherited

element type

◆ obj_ptr

void* obj_ptr
inherited