Exemplo n.º 1
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     if (m_AudRecorder != null && false == String.IsNullOrEmpty(sWavToSend))
     {
         CReadWavFile wf = new CReadWavFile(sWavToSend);
         if (wf.ChannelCount != 1 || wf.BitsPerSecond != 16)
         {
             MessageBox.Show("Incompatible WAV file format", "Unable to send", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             return;
         }
         PttLib.IContacts cnts = axMesh.Contacts;
         PttLib.IMessage  msg  = null;
         List <string>    lst  = new List <string>();
         foreach (object chk in cbSendAudioFile.CheckedItems)
         {
             ContactInfo ci = chk as ContactInfo;
             if (ci != null)
             {
                 lst.Add(ci.id);
             }
         }
         if (lst.Count > 0)
         {
             PttLib.IAudioStream   strm = m_AudRecorder.MessageOutBeginEx(lst.ToArray(), string.Empty, out msg);
             AudioMessageRecording rec  = new AudioMessageRecording(wf);
             rec.AllDataWritten += new EventHandler(Recording_AllDataWritten);
             lstOutMessages.Add(rec);
             rec.SetStream(strm);
         }
     }
 }
Exemplo n.º 2
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);
             }
         }
     });
 }