C# Naudio BufferedWaveProvider Buffer Full Problem

Jun 23 at 4:27 PM
Edited Jun 23 at 4:30 PM
I am getting a buffer full exception on BufferedWaveProvider when I am sending a real time audio stream from Android using websocket connection.
class Program
    {
        
        
        static WaveOut waveOut;
        static BufferedWaveProvider bufferedWaveProvider = null;
        private static SpeechSynthesizer ss;
        private static SpeechRecognitionEngine sre;
        private static int temperature = 75;
        private static WebSocketServer appServer = new WebSocketServer();
        private static int total = 0;
        private static WaveFileWriter writer = new WaveFileWriter("recording.wav", new WaveFormat(44100, 16, 2));
        private static MemoryStream memStream = new MemoryStream();

        static void Main(string[] args)
        {

            Console.WriteLine("Press any key to start the WebSocketServer!");
            Console.ReadKey();
            Console.WriteLine();
            waveOut = new WaveOut();            
            bufferedWaveProvider = new BufferedWaveProvider(new WaveFormat());           
            waveOut.Init(bufferedWaveProvider);
            waveOut.Play();    
            appServer.NewDataReceived += new SessionHandler<WebSocketSession, byte[]>(appServer_NewDataReceived);
            appServer.NewSessionConnected += AppServer_NewSessionConnected;           
            appServer.SessionClosed += new SessionHandler<WebSocketSession, CloseReason>(appServer_SessionClosed);    
            
            //Setup the appServer
            if (!appServer.Setup(80)) //Setup with listening port
            {
                Console.WriteLine("Failed to setup!");
                Console.ReadKey();
                return;
            }

            //Try to start the appServer
            if (!appServer.Start())
            {
                Console.WriteLine("Failed to start!");
                Console.ReadKey();
                return;
            }
            
            Console.WriteLine("The server started successfully, press key 'q' to stop it!");
        
            while (Console.ReadKey().KeyChar != 'q')
            {
                Console.WriteLine();
                continue;
            }

            //Stop the appServer
            appServer.Stop();
            Console.WriteLine();
            Console.WriteLine("The server was stopped!");
            Console.ReadKey();
        }

        static void appServer_NewDataReceived(WebSocketSession session, byte[] value)
        {
            total = total + value.Length;            
            Console.WriteLine("Receiving!! " + total);
            bufferedWaveProvider.AddSamples(value, 0, value.Length);
        }