- Android
- iOS
- JavaScript
- Flutter
- ReactNative
- HarmonyOS
VoiceMessage is the SDK’s built-in voice message type. Its contentType value is jg:voice.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | String | Local audio file path. | 1.0.0 |
| url | String | Remote audio file URL. | 1.0.0 |
| duration | int | Audio duration in seconds. | 1.0.0 |
| extra | String | Extension fields. | 1.0.0 |
JVoiceMessage is the SDK’s built-in voice message type. Its contentType value is jg:voice.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | NSString | Local audio file path. | 1.0.0 |
| url | NSString | Remote audio file URL. | 1.0.0 |
| duration | long | Audio duration in seconds. | 1.0.0 |
| extra | NSString | Extension fields. | 1.0.0 |
Voice messages are built-in SDK message types. The corresponding enum is MessageType.VOICE
| Property | Type | Description | Version |
|---|---|---|---|
| url | String | Voice-message audio URL. The storage location depends on the file storage location configured when sending the audio. | 1.0.0 |
| type | String | Voice-message audio format. The default is AAC; it can be changed when sending the voice message. AAC is recommended for its high quality and small size. | 1.0.0 |
| duration | Number | Audio duration in seconds. | 1.0.0 |
| extra | String | Additional message content. JSON strings are supported and cannot be changed after setting. | 1.0.0 |
let voiceMsg = {
url: 'https://example.com/xxas.aac',
type: 'aac',
duration: 40,
extra: '{"Priority":"P0"}'
}
let message = {
conversationType: ConversationType.PRIVATE,
conversationId: 'userId1',
name: MessageType.VOICE,
content: voiceMsg
};
VoiceMessage is the SDK’s built-in voice message type. Its contentType value is jg:voice.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | String | Local audio file path. | 0.6.3 |
| url | String | Remote audio file URL. | 0.6.3 |
| duration | int | Audio duration in seconds. | 0.6.3 |
| extra | String | Extension fields. | 0.6.3 |
VoiceMessageContent is the SDK’s built-in voice message type. Its contentType value is jg:voice.
| Property | Type | Description | Version |
|---|---|---|---|
| localPath | string | Local audio file path. | 1.0.0 |
| url | string | Remote audio file URL. | 1.0.0 |
| duration | number | Audio duration in seconds. | 1.0.0 |
| extra | string | Extension fields. | 1.0.0 |
VoiceMessage is the SDK’s built-in voice message type. Its contentType value is jg:voice.
| Property | Type | Description | Version |
|---|---|---|---|
| url | string | Remote audio file URL. | 1.0.0 |
| duration | number | Audio duration in seconds. | 1.0.0 |
| extra | string | Extension fields. | 1.0.0 |