How to use resemble ai api

I have tried to create a project in which I can use my voice in text to speech in Javascript but I recieved an error saying this.

Here's my code:-

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

    <input class="form-control" id="text">

    <button type="button" class="btn btn-primary btn-lg" id="speak">Speak</button>

                var HttpClient = function() {
            this.get = function(aUrl, aCallback) {
                var anHttpRequest = new XMLHttpRequest();
                anHttpRequest.onreadystatechange = function() {
                    if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)

      "GET", aUrl, true);
        var theurl = '';
        var client = new HttpClient();
                client.get(theurl, function(response) {
                    response1 = resemble.voices.get('14ebc696');
        const Resemble = require('@resemble/node')
        const resemble = new Resemble('v2', 'zDoirHoJUI3xhHHnrPBH7wtt')
        var text = document.querySelector('#text');
        var speak = document.querySelector('#speak');

        let voices = [];


        function speakNow(){
            var speech = new SpeechSynthesisUtterance();
            speech.rate = .7;
            speech.pitch = 1;
            speech.volume = 1;
            speech.voice = response1;
            speech.text = text.value;


        speak.onclick = function (e) {


And you can also view my project here:-

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum