Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Event Stage - 真面目に作ったけど 全くウケなくてクソだったアプリ/I ma...

Event Stage - 真面目に作ったけど 全くウケなくてクソだったアプリ/I made new service but they say shit

成仏してくれ

果物リン

January 23, 2022
Tweet

More Decks by 果物リン

Other Decks in Technology

Transcript

  1. async function tts(text){ const res = await fetch(BASE_URL + `tts?text=${text}`).then((res)

    => res.json()) const u8 = new Uint8Array(res[0].audioContent.data) return arrayBufferToBase64(u8) } function arrayBufferToBase64(buffer: Uint8Array) { let binary = "" const bytes = new Uint8Array(buffer) const len = bytes.byteLength for (let i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]) } return window.btoa(binary) } ˎΠϝʔδ