Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
uses: OpenTTD/actions/.github/workflows/rw-entry-release-baseset.yml@v7
secrets: inherit
with:
apt-packages: catcodec
apt-packages: catcodec opus-tools
name: opensfx
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
name: Testing
uses: OpenTTD/actions/.github/workflows/rw-entry-testing-baseset.yml@v7
with:
apt-packages: catcodec
apt-packages: catcodec opus-tools
name: opensfx
9 changes: 8 additions & 1 deletion Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ SOUND_FILE := $(BASE_FILENAME).cat
OBS_FILE := $(BASE_FILENAME).obs
SFO_FILE := $(BASE_FILENAME).sfo

SOUND_FILES := $(wildcard src/wav/*.wav)
REPLACE_EXTENSION := {{EXTENSION}}
FILE_EXTENSION := opus

WAV_SOUND_FILES := $(wildcard src/wav/*.wav)
SOUND_FILES := $(subst wav,$(FILE_EXTENSION),$(WAV_SOUND_FILES))
LANG_FILES := $(wildcard lang/*.lng)

BUNDLE_FILES = $(BASE_FILENAME).obs $(DOC_FILES) $(SOUND_FILE)
Expand All @@ -21,6 +25,9 @@ MD5_SRC_FILENAME := $(BASE_FILENAME).obs
CATCODEC := catcodec
CATCODEC_FLAGS := -e

OPUSENC := opusenc
OPUSENC_FLAGS := --quiet --bitrate 64 --downmix-mono

# If everything is default, you don't need the rest:

# comment out those dirs which are not in use
Expand Down
20 changes: 14 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

%.sfo: %.psfo
$(_V) cat $< \
| sed -e "s/$(REPLACE_TITLE)/$(REPO_TITLE)/" \
| sed -e "s/$(REPLACE_GRFID)/$(GRF_ID)/" \
| sed -e "s/$(REPLACE_REVISION)/$(NEWGRF_VERSION)/" \
| sed -e "s/$(REPLACE_FILENAME)/$(OUTPUT_FILENAME)/" \
| sed -e "s/$(REPLACE_TITLE)/$(REPO_TITLE)/g" \
| sed -e "s/$(REPLACE_GRFID)/$(GRF_ID)/g" \
| sed -e "s/$(REPLACE_REVISION)/$(NEWGRF_VERSION)/g" \
| sed -e "s/$(REPLACE_FILENAME)/$(OUTPUT_FILENAME)/g" \
| sed -e "s/$(REPLACE_EXTENSION)/$(FILE_EXTENSION)/g" \
> $@
$(_V) [ -z "$(UNIX2DOS)" ] || $(UNIX2DOS) $(UNIX2DOS_FLAGS) $@

MD5SUM ?= $(shell command -v md5sum 2>/dev/null)

$(SRC_DIR)/$(FILE_EXTENSION)/%.$(FILE_EXTENSION): $(SRC_DIR)/wav/%.wav
$(_E) "[Generating] $@"
$(_V) mkdir -p $(SRC_DIR)/$(FILE_EXTENSION)/
$(_V) $(OPUSENC) $(OPUSENC_FLAGS) $< $@

$(SOUND_FILE): $(SRC_DIR)/$(BASE_FILENAME).sfo $(SOUND_FILES) Makefile Makefile.in Makefile.config
# replace the place holders for version and name by the respective variables:
$(_E) "[Generating] $@ with dep $^"
Expand Down Expand Up @@ -49,7 +55,9 @@ endif
sound: $(OBS_FILE)

clean::
$(_E) "[CLEAN SOUND SRC]"
$(_V) -rm -f $(OBS_FILE)
$(_V) -rm -f $(SOUND_FILE)
$(_V) -rm -f src/$(SOUND_FILE)
$(_V) -rm -f src/$(SFO_FILE)
$(_V) -rm -f $(SRC_DIR)/$(BASE_FILENAME).sfo
$(_V) -rm -f $(SRC_DIR)/$(SOUND_FILE)
$(_V) -rm -f $(SRC_DIR)/$(SFO_FILE)
Loading
Loading