Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Post: VolumeMeter

$
0
0

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
                                    {
                                    }
                                }
                            );

                        }

{

}

}

);

}


Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>