public VoipCall(List <PacketParser.AudioStream> audioStreamList, PacketParser.FileTransfer.FileStreamAssembler wavAssembler, string callId, string from, string to, Func <DateTime, string> toCustomTimeZoneStringFunction) : base() { this.toCustomTimeZoneStringFunction = toCustomTimeZoneStringFunction; this.reconstructedFile = null; //audioStream.Assembler.FileReconstructed += this.Assembler_FileReconstructed; wavAssembler.FileReconstructed += this.OnWavFileReconstructed; this.Start = DateTime.MaxValue; this.End = DateTime.MinValue; foreach (PacketParser.AudioStream stream in audioStreamList) { if (stream.StartTime < this.Start) { this.Start = stream.StartTime; } if (stream.EndTime > this.End) { this.End = stream.EndTime; } } this.CallId = callId; this.From = from; this.To = to; this.SourceHost = audioStreamList[0].SourceHost; this.DestinationkHost = audioStreamList[0].DestinationHost; this.Encoding = audioStreamList[0].Format; this.EncodingString = this.Encoding.ToString(); if (this.EncodingString.StartsWith(FORMAT_PREFIX)) { this.EncodingString = this.EncodingString.Substring(FORMAT_PREFIX.Length); } }
private void OnWavFileReconstructed(string extendedFileId, PacketParser.FileTransfer.ReconstructedFile file) { this.reconstructedFile = file; //this.player = new System.Media.SoundPlayer(this.reconstructedFile.FilePath); }