VolumeMeter

Dec 6, 2011 at 1:08 PM

Im having Problem Adding Volume Meter  on WaveOut

 i wish to detect  sending sound  end  receving sound  similar  to Control  Volume   i did try any  way buth no sucses   on volume   setings i did  this  wich it  work  fine

 

     var waveOut = new WaveOut();
                            waveOut.Volume = volumeSlider1.Volume;
                            fWaveOutsByClient.Add(Transuser, fastEnumerator);
                            waveProvider = new BufferedWaveProvider(codec.RecordFormat);
                         
                            waveOut.Init(waveProvider);

                            waveOut.Play();
                            UnlimitedThreadPool.Run
                            (
                                () =>
                                {
                                    try
                                    {
                                        while (true)
                                        {
                                            byte[] encoded = fastEnumerator.GetNext();

                                            if (encoded == null)
                                                return;
                                             waveOut.Volume = volumeSlider1.Volume;
                                            byte[] decoded = codec.Decode(encoded, 0, encoded.Length);
                                         
                                            waveProvider.AddSamples(decoded, 0, decoded.Length);
                                        }
                                    }
                                    catch
                                    {
                                    }
                                }
                            );

                        }

{

}

}

);

}