LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXVoiceAttachment#

Audio attachment

#include <bmx_voice_attachment.h>

Inherits from floo::BMXFileAttachment, floo::BMXMessageAttachment, BMXBaseObject

Public Functions#

Name
BMXVoiceAttachment(const std::string & path, int duration, const std::string & displayName ="")
Constructor to build the audio attachment to send
BMXVoiceAttachment(const std::string & ratelUrl, int duration, const std::string & displayName, int64_t fileLength)
Constructor to build the audio attachment to receive
virtual~BMXVoiceAttachment()
Destructor
virtual Typetype() const
Type of returned file
virtual BMXMessageAttachmentPtrclone() const
Cloning function
int32_tduration() const
Length of speech

Friends#

Additional inherited members#

Public Functions inherited from floo::BMXFileAttachment

Name
BMXFileAttachment(const std::string & path, const std::string & displayName ="")
Constructor to build the message attachment of sent file
BMXFileAttachment(const std::string & ratelUrl, const std::string & displayName, int64_t fileLength)
Constructor to build the message attachment of received file
virtual~BMXFileAttachment()
Destructor
const std::string &path() const
Local path
const std::string &displayName() const
Display name
const std::string &ratelUrl() const
URL for remote ratel
const std::string &url() const
URL for remote
int64_tfileLength() const
File length
DownloadStatusdownloadStatus() const
Attachment download state

Protected Attributes inherited from floo::BMXFileAttachment

Name
std::stringmPath
std::stringmDisplayName
std::stringmRatelUrl
std::stringmUrl
int64_tmFileLength
DownloadStatusmDownloadStatus

Friends inherited from floo::BMXFileAttachment

Public Types inherited from floo::BMXMessageAttachment

Name
enum classType { Image, Voice, Video, File, Location, Command, Forward}
Attachment type
enum classDownloadStatus { Downloaing, Successed, Failed, NotStart, Canceled}
Attachment download state

Public Functions inherited from floo::BMXMessageAttachment

Name
BMXMessageAttachment()
Constructor
virtual~BMXMessageAttachment()
Destructor

Public Functions Documentation#

function BMXVoiceAttachment#

BMXVoiceAttachment(
    const std::string & path,
    int duration,
    const std::string & displayName =""
)

Constructor to build the audio attachment to send

Parameters:

  • path Local path of file
  • duration Audio length
  • displayName Display name of file

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="BMXVoiceAttachment" %}{% endlanying_code_snippet %}

function BMXVoiceAttachment#

BMXVoiceAttachment(
    const std::string & ratelUrl,
    int duration,
    const std::string & displayName,
    int64_t fileLength
)

Constructor to build the audio attachment to receive

Parameters:

  • ratelUrl Address of ratel file server
  • duration Audio length
  • displayName Display name of file
  • fileLength File size

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="BMXVoiceAttachment" %}{% endlanying_code_snippet %}

function ~BMXVoiceAttachment#

inline virtual ~BMXVoiceAttachment()

Destructor

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="~BMXVoiceAttachment" %}{% endlanying_code_snippet %}

function type#

inline virtual Type type() const

Type of returned file

Return: Type

Reimplements: floo::BMXFileAttachment::type

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="type" %}{% endlanying_code_snippet %}

function clone#

virtual BMXMessageAttachmentPtr clone() const

Cloning function

Return: BMXMessageAttachmentPtr

Reimplements: floo::BMXFileAttachment::clone

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="clone" %}{% endlanying_code_snippet %}

function duration#

int32_t duration() const

Length of speech

Return: int32_t

Friends#

friend Encoder< BMXVoiceAttachment >#

friend class Encoder< BMXVoiceAttachment >(
    Encoder< BMXVoiceAttachment > 
);

friend Decoder< BMXVoiceAttachment >#

friend class Decoder< BMXVoiceAttachment >(
    Decoder< BMXVoiceAttachment > 
);

Example:

{% lanying_code_snippet repo="lanying-im-embedded",class="BMXVoiceAttachment",function="duration" %}{% endlanying_code_snippet %}

Updated on 2022-01-26 at 17:20:40 +0800

Generated API content with concise AI notes where context helps.