From 8c2d6ce37d709cd6ed91856b26baa943ed0ce41b Mon Sep 17 00:00:00 2001 From: akorzunin Date: Fri, 16 Aug 2024 21:26:25 +0300 Subject: [PATCH] fix: resample audio asset cuz pitch rate stopped working in gd4.3 --- scripts/respeed_audio.sh | 14 ++++++++++++++ src/scenes/MainScene.tscn | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scripts/respeed_audio.sh diff --git a/scripts/respeed_audio.sh b/scripts/respeed_audio.sh new file mode 100644 index 0000000..bb4ea0e --- /dev/null +++ b/scripts/respeed_audio.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Define the source and target files +SOURCE_FILE="assets/build/ost/section_change.wav" +TARGET_FILE="assets/build/ost/section_change_v1.wav" + +# Define the speed adjustment factor + +SPEED_FACTOR=1.95 + +# FFmpeg command to adjust speed and save the file +ffmpeg -i "$SOURCE_FILE" -filter:a \ + "asetrate=44100*$SPEED_FACTOR,aresample=44100,aresample=resampler=soxr:out_sample_rate=41000" \ + "$TARGET_FILE" diff --git a/src/scenes/MainScene.tscn b/src/scenes/MainScene.tscn index d937e16..b9eb593 100644 --- a/src/scenes/MainScene.tscn +++ b/src/scenes/MainScene.tscn @@ -34,7 +34,6 @@ script = ExtResource("5_6wmow") [node name="SectionChanged" type="AudioStreamPlayer" parent="SfxPlayer"] stream = ExtResource("6_qd6xe") -pitch_scale = 1.95 bus = &"sfx" [node name="SectionSelect" type="AudioStreamPlayer" parent="SfxPlayer"]