human: 如何处理七牛云的即时通讯BMXVoiceAttachment

gpt: [即时通讯](https://developer.qiniu.com/IM) > API 文档 > [ANDROID
API](https://developer.qiniu.com/IM/api/8191/android-im-class-indexes) >
BMXVoiceAttachment

#  BMXVoiceAttachment

最近更新时间: 2021-07-20 09:54:56

## 类 BMXVoiceAttachment

  * java.lang.Object

  *     * BMXBaseObject
    *       * im.floo.floolib.BMXMessageAttachment
      *         * im.floo.floolib.BMXFileAttachment
        *           * im.floo.floolib.BMXVoiceAttachment
  * * * *
    
        public class BMXVoiceAttachment
    extends BMXFileAttachment
    

音频消息附件

  *     * ### 嵌套类概要

      * ### 从类继承的嵌套类/接口 im.floo.floolib.BMXMessageAttachment

`BMXMessageAttachment.DownloadStatus, BMXMessageAttachment.Size,
BMXMessageAttachment.Type`

    * ### 构造器概要

构造器 限定符 | 构造器和说明  
---|---  
`protected ` | `BMXVoiceAttachment(long cPtr, boolean cMemoryOwn)`  
` ` | `BMXVoiceAttachment(java.lang.String path, int duration)`  
` ` | `BMXVoiceAttachment(java.lang.String path, int duration, java.lang.String displayName)` 构造函数，构建发送音频消息附件   
` ` | `BMXVoiceAttachment(java.lang.String ratelUrl, int duration, java.lang.String displayName, long fileLength)` 构造函数，构建接收音频消息附件   
  
    * ### 方法概要

所有方法 静态方法 实例方法 具体方法 限定符和类型 | 方法和说明  
---|---  
`BMXMessageAttachment` | `clone()` 克隆函数   
`void` | `delete()`  
`int` | `duration()` 语音时长   
`static BMXVoiceAttachment` | `dynamic_cast(BMXMessageAttachment attachment)`  
`protected void` | `finalize()`  
`protected static long` | `getCPtr(BMXVoiceAttachment obj)`  
`BMXMessageAttachment.Type` | `type()` 返回文件类型   
  
      * ### 从类继承的方法 im.floo.floolib.BMXFileAttachment

`displayName, downloadStatus, fileLength, getCPtr, path, ratelUrl, url`

      * ### 从类继承的方法 im.floo.floolib.BMXMessageAttachment

`getCPtr`

      * ### 从类继承的方法 java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  *     * ### 构造器详细资料

      * #### BMXVoiceAttachment
            
                        protected BMXVoiceAttachment(long cPtr,
                                         boolean cMemoryOwn)
            

      * #### BMXVoiceAttachment
            
                        public BMXVoiceAttachment(java.lang.String path,
                                      int duration,
                                      java.lang.String displayName)
            

构造函数，构建发送音频消息附件

参数:

`path` \- 文件的本地路径

`duration` \- 音频时长

`displayName` \- 文件展示名

      * #### BMXVoiceAttachment
            
                        public BMXVoiceAttachment(java.lang.String path,
                                      int duration)
            

      * #### BMXVoiceAttachment
            
                        public BMXVoiceAttachment(java.lang.String ratelUrl,
                                      int duration,
                                      java.lang.String displayName,
                                      long fileLength)
            

构造函数，构建接收音频消息附件

参数:

`ratelUrl` \- ratel服务器地址

`duration` \- 音频时长

`displayName` \- 文件展示名

`fileLength` \- 文件大小

    * ### 方法详细资料

      * #### getCPtr
            
                        protected static long getCPtr(BMXVoiceAttachment obj)
            

      * #### finalize
            
                        protected void finalize()
            

覆盖:

`finalize` 在类中 `BMXFileAttachment`

      * #### delete
            
                        public void delete()
            

覆盖:

`delete` 在类中 `BMXFileAttachment`

      * #### type
            
                        public BMXMessageAttachment.Type type()
            

返回文件类型

覆盖:

`type` 在类中 `BMXFileAttachment`

返回:

Type

      * #### clone
            
                        public BMXMessageAttachment clone()
            

克隆函数

覆盖:

`clone` 在类中 `BMXFileAttachment`

返回:

BMXMessageAttachmentPtr

      * #### duration
            
                        public int duration()
            

语音时长

返回:

int32_t

      * #### dynamic_cast
            
                        public static BMXVoiceAttachment dynamic_cast(BMXMessageAttachment attachment)

以上内容是否对您有帮助？