Implementation
factory NIMMessage.audioEmptyMessage(
{required String sessionId,
required NIMSessionType sessionType,
required String filePath,
required int fileSize,
required int duration,
String? displayName,
NIMNosScene nosScene = NIMNosScenes.defaultIm}) {
/// The minimum time for display is 1 second.
if (duration < 1000) duration = 1000;
var extension = filePath.split('.').last;
var audioAttachment = NIMAudioAttachment(
path: filePath,
size: fileSize,
duration: duration,
extension: extension,
nosScene: nosScene);
return NIMMessage(
messageDirection: NIMMessageDirection.outgoing,
messageType: NIMMessageType.audio,
timestamp: new DateTime.now().millisecondsSinceEpoch,
status: NIMMessageStatus.sending,
sessionId: sessionId,
sessionType: sessionType,
messageAttachment: audioAttachment);
}