File size: 1,174 Bytes
348b63c
 
 
 
 
22d102f
 
d5a47b7
22d102f
d5a47b7
 
22d102f
 
fe0b3db
22d102f
 
 
 
 
6a3d819
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# for older versions of sox:
# RawParams=-r 44100 -c 1 -s -2
# for newer versions:
RawParams=-r 44100 -c 1 -e signed -b 16

SHELL=/bin/bash

cameron-voice.exe: jyutping-wong setup.bat cameron-exe-readme.txt unzipsfx.exe
	mkdir -p partials/cant/wong
	pushd jyutping-wong ; for N in *.wav ; do sox $$N $(RawParams) $$(echo $$N|sed -e s/wav/raw/); done; popd
	mv jyutping-wong/*.raw partials/cant/wong/
	sox -t raw $(RawParams) /dev/null -t wav - 2>/dev/null | cat > partials/header.wav
	cp cameron-exe-readme.txt partials/cant/README.txt
	for N in setup.bat partials/cant/README.txt ; do python3 -c "import sys; sys.stdout.buffer.write(sys.stdin.buffer.read().replace(b'\r',b'').replace(b'\n',b'\r\n'))" < $$N > n && mv n $$N; done
	find setup.bat partials -type f | sort | zip -q -9 cameron-voice.zip -@
	echo '$$AUTORUN$$>setup.bat' | zip -z cameron-voice.zip
	cat unzipsfx.exe cameron-voice.zip > cameron-voice.exe
	zip -A cameron-voice.exe
	rm -rf partials cameron-voice.zip

metadata.csv: # for HuggingFace
	echo filename,syllable,tone > $@
	for N in jyutping-wong/*.wav; do echo $$N,$$(echo $$N|sed -e s,.*/,, -e s/[1-7].*//),$$(echo $$N|sed -e s,[^1-7],,g); done >> $@