import json from urllib.parse import urlparse from http.server import HTTPServer, BaseHTTPRequestHandler from image_util import load_image import unittest import time import accessible_output2.outputs.auto import os import base64 po = test.PackageOutput("ff1_data.lud", "enemy_lookup.dat") auto_obj = accessible_output2.outputs.auto.Auto() def text_to_sound(string): string = string.replace("\"", "'") os.system("espeak \""+string+"\" --stdout > wave_out.wav") data = base64.b64encode(open("wave_out.wav").read()) return data class MainHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(self): self.send_response(200) self.send_header("Content-type", "text/html") self.end_headers() self.wfile.write("