/// <summary>
        /// Process the response from the websocket
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void WebSocket_MessageReceived(MessageWebSocket sender, MessageWebSocketMessageReceivedEventArgs args)
        {
            try
            {
                if (args.MessageType == SocketMessageType.Utf8)
                {
                    // parse the text result that contains the recognition and translation
                    // {"type":"final","id":"0","recognition":"Hello, can you hear me now?","translation":"Hallo, kannst du mich jetzt hören?"}
                    string jsonOutput;
                    using (var dataReader = args.GetDataReader())
                    {
                        dataReader.UnicodeEncoding = Windows.Storage.Streams.UnicodeEncoding.Utf8;
                        jsonOutput = dataReader.ReadString(dataReader.UnconsumedBufferLength);
                    }

                    var result = JsonConvert.DeserializeObject <Result>(jsonOutput);
                    this.onSpeechTranslateResult(result);
                }
                else if (args.MessageType == SocketMessageType.Binary)
                {
                    // the binary output is the text to speech audio
                    using (var dataReader = args.GetDataReader())
                    {
                        dataReader.ByteOrder = ByteOrder.LittleEndian;
                        this.onTextToSpeechData(AudioFrameHelper.GetAudioFrame(dataReader));
                    }
                }
            }
            catch (Exception e)
            {
                this.onSpeechTranslateResult(new Result()
                {
                    Status = e.Message
                });
            }
        }
 /// <summary>
 /// Send audio frame to the Machine Translation Service
 /// </summary>
 /// <param name="frame"></param>
 public void SendAudioFrame(AudioFrame frame)
 {
     AudioFrameHelper.SendAudioFrame(frame, this.dataWriter);
 }