Skip to content

Commit faa75d3

Browse files
author
ByteSizedFox
committed
add webassembly port
1 parent 284de9b commit faa75d3

21 files changed

Lines changed: 455 additions & 202 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
out/
88
toolchain
99
say
10-
10+
/wip

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
A smaller version of dectalk intended for portability between platforms
1+
A version of dectalk intended for portability between platforms
22
supports windows, unix-like operating systems (such as Linux, MacOS, BSD, and others), and Android
3+
depending on the platform, it's nearly identical to the main [DECtalk](https://github.com/dectalk/dectalk) repo with the exception of loadv and setv commands and minor platform-specific fixes
34

45
dependencies for gui:
56
```
@@ -37,3 +38,5 @@ see the [android-develop](https://github.com/dectalk/DECtalkMini/tree/android-de
3738
to compile for rpi pico, install the pico SDK and use cmake in the pico folder
3839

3940
to compile for gameboy advance, install gba-dev from pacman following [this guide](https://devkitpro.org/wiki/Getting_Started) and use make in the gba folder
41+
42+
note unsupported: if your device isn't on this list, try native anyways, most platforms with a compiler should be able to compile this

pico/main.c.txt

Lines changed: 0 additions & 200 deletions
This file was deleted.

src/ph_claus.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ void affichetab4 (PDPH_T pDph_t);
192192
#endif
193193
void printParameters (PDPH_T pDph_t);
194194

195+
short last_phoneme;
195196

196197
// called by function kltask in ph_task.c for each clause read from the pipe.
197198
// input phone and special marks (WBOUND, PERIOD, etc.) are in symbols[],
@@ -367,6 +368,7 @@ else
367368
#ifndef EPSON_ARM7
368369
while (TRUE)
369370
{
371+
last_phoneme = pDph_t->allophons[pDph_t->nphone];
370372
#endif
371373
#ifdef EPSON_ARM7
372374
send_pars_loop(phTTS);

wasm/compile.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
emcc main.c ../src/*.c -I ../include -o DECtalkMini.js \
2+
-s WASM=1 \
3+
-s EXPORTED_FUNCTIONS='["_tts_init","_tts_speak","_tts_get_buffer","_tts_get_buffer_length","_tts_reset","_tts_get_last_phone","_malloc","_free"]' \
4+
-s EXPORTED_RUNTIME_METHODS='["cwrap","ccall","getValue","setValue","UTF8ToString","stringToUTF8","HEAP16"]' \
5+
-s ALLOW_MEMORY_GROWTH=1 \
6+
-s INITIAL_MEMORY=33554432 \
7+
-s MODULARIZE=1 \
8+
-s EXPORT_NAME="DECtalkMini" \
9+
-DNO_FILESYSTEM -D_REENTRANT=1 -DNOMME=1 -DLTSSIM=1 -DTTSSIM=1 -DANSI=1 -DBLD_DECTALK_DLL=1 -DENGLISH=1 -DENGLISH_US=1 -DACCESS32=1 -DTYPING_MODE=1 -DACNA=1 -DDISABLE_AUDIO=1 -DSINGLE_THREADED=1 -D__unix__=1

wasm/img/a_aa_uh.svg

Lines changed: 1 addition & 0 deletions
Loading

wasm/img/ax_i_ii.svg

Lines changed: 1 addition & 0 deletions
Loading

wasm/img/e.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)