createAudioMessage static method
- {required String sessionId,
- required NIMSessionType sessionType,
- required String filePath,
- required int fileSize,
- required int duration,
- String? base64,
- String? displayName,
- NIMNosScene nosScene = NIMNosScenes.defaultIm}
创建音频消息
displayName
字段无效,不建议使用
base64
字段为web端专用,web端filePath
可传空字符串
Implementation
static Future<NIMResult<NIMMessage>> createAudioMessage(
{required String sessionId,
required NIMSessionType sessionType,
required String filePath,
required int fileSize,
required int duration,
String? base64,
String? displayName,
NIMNosScene nosScene = NIMNosScenes.defaultIm}) async {
var message = NIMMessage.audioEmptyMessage(
sessionId: sessionId,
sessionType: sessionType,
filePath: filePath,
fileSize: fileSize,
base64: base64,
duration: duration,
displayName: displayName,
nosScene: nosScene);
return NimCore.instance.messageService._createMessage(message: message);
}