示例#1
0
 void startAudioForwarding(WavBuffer wb)
 {
     BeginInvoke((MethodInvoker) delegate
     {
         if (m_AudRecorder != null && wb != null && contactsMesh != null)
         {
             PttLib.IMessage msg = null;
             List <string> lst   = new List <string>();
             foreach (string id in lstForwardContactIds)
             {
                 lst.Add(id);
             }
             if (lst.Count > 0)
             {
                 PttLib.IAudioStream strm  = m_AudRecorder.MessageOutBeginEx(lst.ToArray(), string.Empty, out msg);
                 AudioMessageRecording rec = new AudioMessageRecording(wb as SoundSample.IReadWav);
                 rec.AllDataWritten       += new EventHandler(Recording_AllDataWritten);
                 lstOutMessages.Add(rec);
                 rec.SetStream(strm);
             }
         }
     });
 }
示例#2
0
        PttLib.IAudioStream PttLib.IAudioMessagePlayback.MessageInBegin(PttLib.IMessage pMessage)
        {
            AudioStreamImpl rv = new AudioStreamImpl(cntMessages);

            if (false == String.IsNullOrEmpty(savePath))
            {
                WriteWav ww = new WriteWav(GetSaveFileName(pMessage));
                if (ww.Valid)
                {
                    rv.AddSink(ww);
                }
            }
            if (bForwardAudio)
            {
                WavBuffer wb = new WavBuffer();
                wb.AudioRcvStarted += dlgt;
                rv.AddSink(wb);
            }
            cntMessages++;
            lstActiveStreams.Add(rv);
            rv.OnEndOfStream += new AudioStreamImpl.dlgtFinished(OnEndOfStream);
            return(rv as PttLib.IAudioStream);
        }