 = message;
                container.append(dMessage);

                chatHistory.appendChild(container);
                chatHistory.scroll(0, chatHistory.scrollHeight);
            }

            function encodeAudio(audioChunks, sampleRate, bitDepth, numChannels) {
                var audioData = mergeUint8Array(audioChunks);

                const dataSize = audioData.length;
                const fileSize = dataSize + 36;
                const blockAlign = numChannels * bitDepth / 8;
               