  audioChunksReceived.push(audioData);
                                playNextChunk();
                            }
                            return;
                        }
                    }
                    ws.onerror = function (evt) {
                        print('ERROR: ' + evt.data);
                    }
                    return false;
                };
                openWs();

                document.getElementById('close').onclick = function (evt) {
                    if (!ws) 