Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit af0fdd8

Browse files
committed
Compress sound effect to save space.
1 parent 79a5c7d commit af0fdd8

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

res/se/Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
VOICE = ../voice
2+
3+
ifeq ($(shell uname -s),Darwin)
4+
# for Mac
5+
CKB2WAV = cktool extract
6+
else
7+
# for WSL
8+
CKB2WAV = $(VOICE)/CKBtoWav.exe
9+
endif
10+
11+
SAMPLE_RATE = 21024
12+
113
lib = lib/libse.a
214
header = include/se.h
315

@@ -7,14 +19,17 @@ ckbs = $(wildcard *.ckb)
719
objects = $(ckbs:.ckb=.o)
820

921
$(lib): $(objects)
10-
arm-none-eabi-ar r $@ $?
22+
$(DEVKITARM)/bin/arm-none-eabi-ar r $@ $?
1123

1224
$(objects): %.o: %.ckb
13-
cktool extract $<
14-
sox $*_$*_extracted.wav -r 21024 -b 8 -c 1 $*.wav
25+
$(CKB2WAV) $<
26+
ifneq ($(shell uname -s),Darwin)
27+
mv $*.wav $*_$*_extracted.wav
28+
endif
29+
sox $*_$*_extracted.wav -r $(SAMPLE_RATE) -b 8 -c 1 $*.wav
1530
rm $*_$*_extracted.wav
16-
../voice/se2m4a/se2m4a.py $*.wav $*.s
17-
arm-none-eabi-as -mcpu=arm7tdmi -I ../voice/se2m4a $*.s -o $@
31+
$(VOICE)/se2m4a/se2m4a.py $*.wav $*.s -c
32+
$(DEVKITARM)/bin/arm-none-eabi-as -mcpu=arm7tdmi -I $(VOICE)/se2m4a $*.s -o $@
1833

1934
$(header): $(lib)
2035
@echo $(foreach ckb, $(ckbs), "extern const struct Song $(subst .ckb,;,$(ckb))\n") > $@

res/se/lib/libse.a

-135 KB
Binary file not shown.

0 commit comments

Comments
 (0)