        nextStartTime = audioCtx.currentTime;
          }
          source.start(nextStartTime);

          // Advance the next start time by the duration of the current buffer
          nextStartTime += audioBuffer.duration;
        }
        queueProcessing = false;
      }

      document.getElementById("record").onclick = async function (evt) {
        if (isRecording) {
          recordStop();
        } else {
          await recordStart();
        }
      };

      function recordStop() {
        sour