sendAudioMessage method
- {required String sessionId,
- required NIMSessionType sessionType,
- required String filePath,
- required int fileSize,
- required int duration,
- String? displayName,
- String? base64,
- NIMNosScene nosScene = NIMNosScenes.defaultIm,
- MessageAction? action}
发送音频消息
displayName
字段无效,不建议使用
base64
字段为web端专用,web端filePath
可传空字符串
Implementation
Future<NIMResult<NIMMessage>> sendAudioMessage({
required String sessionId,
required NIMSessionType sessionType,
required String filePath,
required int fileSize,
required int duration,
String? displayName,
String? base64,
NIMNosScene nosScene = NIMNosScenes.defaultIm,
MessageAction? action,
}) async {
final message = NIMMessage.audioEmptyMessage(
sessionId: sessionId,
sessionType: sessionType,
filePath: filePath,
fileSize: fileSize,
base64: base64,
duration: duration,
displayName: displayName,
nosScene: nosScene);
return _createMessageAndSend(message, action);
}