export default function renderLogic(speech,callback,dhDriver){
    switch (speech.type) {
      case "tts":
        callback({
          name: "tts",
          data: { ...speech },
        });
        callback({
          name: "lyric",
          data: { ...speech },
        });
        break;
      case "dh":
        dhDriver?.textRender(speech.text);
        setTimeout(() => {
            callback({
            name: "dh",
            data: { ...speech },
          });
          callback({
            name: "lyric",
            data: { ...speech },
          });
        }, -speech.delay);
        break;
      case "video":
        break;
      default:
        callback({
          name: speech.type,
          data: speech.data ? speech.data : speech,
        });
    }
  }