       let str = state.toString(2);
          let pad = "0b00000000"
          let text = pad.substring(0, pad.length - str.length) + str
          document.querySelector('code').innerHTML = text;
        }

        const decode = () => {
          let prevState = 0;
          let duplicates = 0;

          const iteration = () => {
            analyser.getByteFrequencyData(buffer);
            let state = getState();
            let duplicateThreshold = +document.querySelector('#duplicate-state-threshold')