How to from byte to mixer?

Dec 18, 2011 at 9:49 PM
Edited Dec 19, 2011 at 1:06 AM

Hi , I have poor English ,I try to use my poor English ask few question.

 

I use Naudio ,I went to create Online Meeting

so I have many client

I have a problem , I don't know how mix byte , when my Server got byte , how  into the mix  WaveMixerStream32? 

I already try few week,but it doesn't work, play help me

there is my code.

 

       WaveIn wi;
        BufferedWaveProvider bwp;
        WaveOut wo;


        private WaveMixerStream32 mixer;
        WaveFileWriter writer;
        public MainWindow()
        {
            InitializeComponent();
            startMic();
        }
        public void startMic()
        {
            wi = new WaveIn { BufferMilliseconds = 5 };//MIC
            wi.DataAvailable += new EventHandler(wi_DataAvailable);
            bwp = new BufferedWaveProvider(wi.WaveFormat);
            wo = new WaveOut { DesiredLatency = 100 };

            wo.Init(bwp);
            wo.Play();
            wi.StartRecording();

        }


        void wi_DataAvailable(object sender, WaveInEventArgs e)
        {
            try
            {           
                bwp.AddSamples(e.Buffer, 0, e.BytesRecorded);
		//there e.buffer will use Udp socket send to Server 
                  and Server want to mix it.  but i fail . i don't know
                  when i get byte ,how to into waveMixerStream32
            }
            catch (Exception)
            {
            }

        }

 

when i get  e.Buffer .I use Udp socket send to Server

then, when Server receive this byte  ,server  want to mix it.

I already search many discussion few week but doesn't work ,please help me~

thanks a lot.

Coordinator
Dec 27, 2011 at 2:49 PM

You need to go from a WaveProvider to a WaveStream (create your own adapter), then use a WaveChannel32 to make a class that can be passed into WaveMixerStream32