Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater
Other
3 stars 0 forks source link

Convert sounds to mono #407

Open Poikilos opened 4 years ago

Poikilos commented 4 years ago

For spatial audio to work, sounds must be mono

List 1

as mentioned in #263 mono-sounds-patch-190613.zip which covers:

Here is a comparison between the old patch and a candidate patch using ffmpeg -ac: Screenshot_2021-11-11_10-29-03

List 2

Detected in Bucket_Game 211107c using findstereofiles.py: (- = skip [skip ones in "src" directories in patch]):

Poikilos commented 3 years ago

stereo to mono only

(no compression options)

I added a feature to mtanalyze to detect stereo files using ffprobe and produce a patch using ffmpeg.

from IRC: <Poikilos> To resolve #407 set BUCKET_GAME to Bucket_Game dir then:

cd EnlivenMinetest && git pull --no-rebase && rsync -rt Bucket_Game-branches/stereo_to_mono-vs-211107c/ $BUCKET_GAME

The files were converted with the following line in findstereofiles.py in the repo above:

Sizes with no additional options (only -ac 1):

$ find -type f -exec ls -lh {} \;
-rw-r--r-- 1 owner owner 7.3K Nov  8 20:26 ./mods/coderfood/unified_foods/sounds/unified_hunger_eat_generic.ogg
-rw-r--r-- 1 owner owner 18K Nov  8 20:26 ./mods/coderbuild/christmas_craft/sounds/snowball_splash.4.ogg
-rw-r--r-- 1 owner owner 9.0K Nov  8 20:26 ./mods/coderbuild/travelnet/sounds/travelnet_bell.ogg
-rw-r--r-- 1 owner owner 16K Nov  8 20:26 ./mods/coderbuild/castle/sounds/orbs_birds.ogg
-rw-r--r-- 1 owner owner 4.6K Nov  8 20:28 ./mods/coderbuild/castle/sounds/castle_crossbow_click.ogg
-rw-r--r-- 1 owner owner 6.1K Nov  8 20:28 ./mods/coderbuild/castle/sounds/ropes_creak.3.ogg
-rw-r--r-- 1 owner owner 25K Nov  8 20:28 ./mods/coderbuild/castle/sounds/orbs_owl.ogg
-rw-r--r-- 1 owner owner 6.8K Nov  8 20:28 ./mods/coderbuild/castle/sounds/ropes_creak.2.ogg
-rw-r--r-- 1 owner owner 7.3K Nov  8 20:28 ./mods/coderbuild/castle/sounds/orbs_ding.ogg
-rw-r--r-- 1 owner owner 5.8K Nov  8 20:28 ./mods/mtmachines/technic/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 9.1K Nov  8 20:28 ./mods/mtmachines/technic/sounds/mining_drill.ogg
-rw-r--r-- 1 owner owner 5.7K Nov  8 20:28 ./mods/mtmachines/technic/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 5.6K Nov  8 20:28 ./mods/mtmachines/technic/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 6.0K Nov  8 20:28 ./mods/mtmachines/technic/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 35K Nov  8 20:28 ./mods/codercore/wiki/sounds/REALZulfikar.ogg
-rw-r--r-- 1 owner owner 17K Nov  8 20:28 ./mods/codercore/tpr/sounds/whoosh.ogg
-rw-r--r-- 1 owner owner 16K Nov  8 20:28 ./mods/codercore/unified_inventory/sounds/birds.ogg
-rw-r--r-- 1 owner owner 25K Nov  8 20:28 ./mods/codercore/unified_inventory/sounds/owl.ogg
-rw-r--r-- 1 owner owner 5.8K Nov  8 20:28 ./mods/codercore/item_drop/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 5.7K Nov  8 20:28 ./mods/codercore/item_drop/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 5.6K Nov  8 20:28 ./mods/codercore/item_drop/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 6.0K Nov  8 20:28 ./mods/codercore/item_drop/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 6.1K Nov  8 20:28 ./mods/codermobs/mobs/sounds/mobs_swing.ogg
-rw-r--r-- 1 owner owner 28K Nov  8 20:28 ./mods/codermobs/codermobs/sounds/codermobs_trex1.ogg
-rw-r--r-- 1 owner owner 23K Nov  8 20:28 ./mods/codermobs/codermobs/sounds/codermobs_trex2.ogg
-rw-r--r-- 1 owner owner 13K Nov  8 20:28 ./mods/codermobs/codermobs/sounds/codermobs_tiger.ogg
-rw-r--r-- 1 owner owner 6.7K Nov  8 20:28 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_war_cry.ogg
-rw-r--r-- 1 owner owner 5.5K Nov  8 20:28 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_attack.2.ogg
Poikilos commented 3 years ago

-qscale:a 1

The conversion script findstereofiles.py (in the mtanalyze repo link mentioned above) can be hard-coded to use different ffmpeg options. Adding the -qscale:a 1 option:

~/git/mtanalyze/findstereofiles.py ~/minetest/games/Bucket_Game --patch ~/git/EnlivenMinetest/Bucket_Game-branches/stereo_to_mono-vs-211107c-qscale_a_1
# ^ Such as if hard-coded "-qscale:a 1" in findstereofiles.py.
# Then analyze difference in size using meld like:
cd ~/git/EnlivenMinetest/Bucket_Game-branches/stereo_to_mono-vs-211107c-qscale_a_1
find -type f -exec ls -lh {} \; > ../stereo_to_mono-vs-211107c-qscale_a_1.stats.txt
cd ..
meld stereo_to_mono-vs-211107c-qscale_a_1.stats.txt stereo_to_mono-vs-211107c.stats.txt

-qscale:a 1 sizes:

-rw-r--r-- 1 owner owner 6.6K Nov 10 14:59 ./mods/coderfood/unified_foods/sounds/unified_hunger_eat_generic.ogg
-rw-r--r-- 1 owner owner 16K Nov 10 14:59 ./mods/coderbuild/christmas_craft/sounds/snowball_splash.4.ogg
-rw-r--r-- 1 owner owner 7.4K Nov 10 14:59 ./mods/coderbuild/travelnet/sounds/travelnet_bell.ogg
-rw-r--r-- 1 owner owner 14K Nov 10 14:59 ./mods/coderbuild/castle/sounds/orbs_birds.ogg
-rw-r--r-- 1 owner owner 4.2K Nov 10 14:59 ./mods/coderbuild/castle/sounds/castle_crossbow_click.ogg
-rw-r--r-- 1 owner owner 5.5K Nov 10 14:59 ./mods/coderbuild/castle/sounds/ropes_creak.3.ogg
-rw-r--r-- 1 owner owner 22K Nov 10 14:59 ./mods/coderbuild/castle/sounds/orbs_owl.ogg
-rw-r--r-- 1 owner owner 6.0K Nov 10 14:59 ./mods/coderbuild/castle/sounds/ropes_creak.2.ogg
-rw-r--r-- 1 owner owner 5.9K Nov 10 14:59 ./mods/coderbuild/castle/sounds/orbs_ding.ogg
-rw-r--r-- 1 owner owner 5.5K Nov 10 14:59 ./mods/mtmachines/technic/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 8.3K Nov 10 14:59 ./mods/mtmachines/technic/sounds/mining_drill.ogg
-rw-r--r-- 1 owner owner 5.2K Nov 10 14:59 ./mods/mtmachines/technic/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 5.2K Nov 10 14:59 ./mods/mtmachines/technic/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 5.7K Nov 10 14:59 ./mods/mtmachines/technic/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 29K Nov 10 14:59 ./mods/codercore/wiki/sounds/REALZulfikar.ogg
-rw-r--r-- 1 owner owner 16K Nov 10 14:59 ./mods/codercore/tpr/sounds/whoosh.ogg
-rw-r--r-- 1 owner owner 14K Nov 10 14:59 ./mods/codercore/unified_inventory/sounds/birds.ogg
-rw-r--r-- 1 owner owner 22K Nov 10 14:59 ./mods/codercore/unified_inventory/sounds/owl.ogg
-rw-r--r-- 1 owner owner 5.5K Nov 10 14:59 ./mods/codercore/item_drop/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 5.2K Nov 10 14:59 ./mods/codercore/item_drop/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 5.2K Nov 10 14:59 ./mods/codercore/item_drop/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 5.7K Nov 10 14:59 ./mods/codercore/item_drop/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 5.7K Nov 10 14:59 ./mods/codermobs/mobs/sounds/mobs_swing.ogg
-rw-r--r-- 1 owner owner 25K Nov 10 14:59 ./mods/codermobs/codermobs/sounds/codermobs_trex1.ogg
-rw-r--r-- 1 owner owner 21K Nov 10 14:59 ./mods/codermobs/codermobs/sounds/codermobs_trex2.ogg
-rw-r--r-- 1 owner owner 11K Nov 10 14:59 ./mods/codermobs/codermobs/sounds/codermobs_tiger.ogg
-rw-r--r-- 1 owner owner 6.1K Nov 10 14:59 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_war_cry.ogg
-rw-r--r-- 1 owner owner 5.2K Nov 10 14:59 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_attack.2.ogg
Poikilos commented 3 years ago

192k

To get the 192k version:

Set BUCKET_GAME to Bucket_Game dir then: cd EnlivenMinetest && git pull && rsync -rt Bucket_Game-branches/stereo_to_mono-vs-211107c-ab_192k/ $BUCKET_GAME

Adding the -ab 192k option:

~/git/mtanalyze/findstereofiles.py ~/minetest/games/Bucket_Game --patch ~/git/EnlivenMinetest/Bucket_Game-branches/stereo_to_mono-vs-211107c-ab_192k
# ^ Such as if hard-coded "-ab 192k" in findstereofiles.py.
# Then analyze difference in size using meld like:
cd ~/git/EnlivenMinetest/Bucket_Game-branches/stereo_to_mono-vs-211107c-ab_192k
find -type f -exec ls -lh {} \; > ../stereo_to_mono-vs-211107c-ab_192k.stats.txt

-ab 192k sizes:

-rw-r--r-- 1 owner owner 17K Nov 10 15:09 ./mods/coderfood/unified_foods/sounds/unified_hunger_eat_generic.ogg
-rw-r--r-- 1 owner owner 34K Nov 10 15:09 ./mods/coderbuild/christmas_craft/sounds/snowball_splash.4.ogg
-rw-r--r-- 1 owner owner 18K Nov 10 15:09 ./mods/coderbuild/travelnet/sounds/travelnet_bell.ogg
-rw-r--r-- 1 owner owner 39K Nov 10 15:09 ./mods/coderbuild/castle/sounds/orbs_birds.ogg
-rw-r--r-- 1 owner owner 7.3K Nov 10 15:09 ./mods/coderbuild/castle/sounds/castle_crossbow_click.ogg
-rw-r--r-- 1 owner owner 0 Nov 10 15:09 ./mods/coderbuild/castle/sounds/ropes_creak.3.ogg
-rw-r--r-- 1 owner owner 58K Nov 10 15:09 ./mods/coderbuild/castle/sounds/orbs_owl.ogg
-rw-r--r-- 1 owner owner 0 Nov 10 15:09 ./mods/coderbuild/castle/sounds/ropes_creak.2.ogg
-rw-r--r-- 1 owner owner 15K Nov 10 15:09 ./mods/coderbuild/castle/sounds/orbs_ding.ogg
-rw-r--r-- 1 owner owner 12K Nov 10 15:09 ./mods/mtmachines/technic/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 19K Nov 10 15:09 ./mods/mtmachines/technic/sounds/mining_drill.ogg
-rw-r--r-- 1 owner owner 9.8K Nov 10 15:09 ./mods/mtmachines/technic/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 11K Nov 10 15:09 ./mods/mtmachines/technic/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 12K Nov 10 15:09 ./mods/mtmachines/technic/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 82K Nov 10 15:09 ./mods/codercore/wiki/sounds/REALZulfikar.ogg
-rw-r--r-- 1 owner owner 38K Nov 10 15:09 ./mods/codercore/tpr/sounds/whoosh.ogg
-rw-r--r-- 1 owner owner 39K Nov 10 15:09 ./mods/codercore/unified_inventory/sounds/birds.ogg
-rw-r--r-- 1 owner owner 58K Nov 10 15:09 ./mods/codercore/unified_inventory/sounds/owl.ogg
-rw-r--r-- 1 owner owner 12K Nov 10 15:09 ./mods/codercore/item_drop/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 9.8K Nov 10 15:09 ./mods/codercore/item_drop/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 11K Nov 10 15:09 ./mods/codercore/item_drop/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 12K Nov 10 15:09 ./mods/codercore/item_drop/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 11K Nov 10 15:09 ./mods/codermobs/mobs/sounds/mobs_swing.ogg
-rw-r--r-- 1 owner owner 67K Nov 10 15:09 ./mods/codermobs/codermobs/sounds/codermobs_trex1.ogg
-rw-r--r-- 1 owner owner 56K Nov 10 15:09 ./mods/codermobs/codermobs/sounds/codermobs_trex2.ogg
-rw-r--r-- 1 owner owner 28K Nov 10 15:09 ./mods/codermobs/codermobs/sounds/codermobs_tiger.ogg
-rw-r--r-- 1 owner owner 11K Nov 10 15:09 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_war_cry.ogg
-rw-r--r-- 1 owner owner 8.2K Nov 10 15:09 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_attack.2.ogg
Poikilos commented 3 years ago

I got the original sizes as follows:

find -type f -exec ls -lh {} \; > ~/EnlivenMinetest/Bucket_Game-base/stereo_to_mono-vs-211107c.stats.txt
# ^ The file has all ogg files not just patched ones, so next do trimpatchstats.py:
cd ~/EnlivenMinetest/Bucket_Game-base && trimpatchstats.py stereo_to_mono-vs-211107c.stats.txt > stereo_to_mono-vs-211107c.stats0.txt
mv stereo_to_mono-vs-211107c.stats0.txt stereo_to_mono-vs-211107c.stats.txt
# ^ Overwrite the one with all names with the one with only patched names.

The original (unmodified bucket_game 211107c) sizes:

-rw-r--r-- 1 owner owner 9.3K Dec 14  2018 ./mods/coderfood/unified_foods/sounds/unified_hunger_eat_generic.ogg
-rw-r--r-- 1 owner owner 24K Dec 16  2018 ./mods/coderbuild/christmas_craft/sounds/snowball_splash.4.ogg
-rw-r--r-- 1 owner owner 19K Jun 22  2019 ./mods/coderbuild/travelnet/sounds/travelnet_bell.ogg
-rw-r--r-- 1 owner owner 15K Apr 21  2020 ./mods/coderbuild/castle/sounds/orbs_birds.ogg
-rw-r--r-- 1 owner owner 7.3K Apr 21  2020 ./mods/coderbuild/castle/sounds/castle_crossbow_click.ogg
-rw-r--r-- 1 owner owner 9.0K Apr 21  2020 ./mods/coderbuild/castle/sounds/ropes_creak.3.ogg
-rw-r--r-- 1 owner owner 50K Apr 21  2020 ./mods/coderbuild/castle/sounds/orbs_owl.ogg
-rw-r--r-- 1 owner owner 11K Apr 21  2020 ./mods/coderbuild/castle/sounds/ropes_creak.2.ogg
-rw-r--r-- 1 owner owner 17K Apr 21  2020 ./mods/coderbuild/castle/sounds/orbs_ding.ogg
-rw-r--r-- 1 owner owner 9.8K Nov 18  2016 ./mods/mtmachines/technic/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 15K Nov 18  2016 ./mods/mtmachines/technic/sounds/mining_drill.ogg
-rw-r--r-- 1 owner owner 9.5K Nov 18  2016 ./mods/mtmachines/technic/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 9.4K Nov 18  2016 ./mods/mtmachines/technic/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 11K Nov 18  2016 ./mods/mtmachines/technic/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 100K Jan  4  2016 ./mods/codercore/wiki/sounds/REALZulfikar.ogg
-rw-r--r-- 1 owner owner 26K Oct 20  2018 ./mods/codercore/tpr/sounds/whoosh.ogg
-rw-r--r-- 1 owner owner 15K Dec 22  2019 ./mods/codercore/unified_inventory/sounds/birds.ogg
-rw-r--r-- 1 owner owner 50K Dec 22  2019 ./mods/codercore/unified_inventory/sounds/owl.ogg
-rw-r--r-- 1 owner owner 9.8K Jun 21 13:50 ./mods/codercore/item_drop/sounds/item_drop_pickup.1.ogg
-rw-r--r-- 1 owner owner 9.5K Jun 21 13:50 ./mods/codercore/item_drop/sounds/item_drop_pickup.4.ogg
-rw-r--r-- 1 owner owner 9.4K Jun 21 13:50 ./mods/codercore/item_drop/sounds/item_drop_pickup.3.ogg
-rw-r--r-- 1 owner owner 11K Jun 21 13:50 ./mods/codercore/item_drop/sounds/item_drop_pickup.2.ogg
-rw-r--r-- 1 owner owner 6.8K Dec 19  2017 ./mods/codermobs/mobs/sounds/mobs_swing.ogg
-rw-r--r-- 1 owner owner 61K Jul 10 10:41 ./mods/codermobs/codermobs/sounds/codermobs_trex1.ogg
-rw-r--r-- 1 owner owner 50K Jul 10 10:41 ./mods/codermobs/codermobs/sounds/codermobs_trex2.ogg
-rw-r--r-- 1 owner owner 19K Jul 10 10:41 ./mods/codermobs/codermobs/sounds/codermobs_tiger.ogg
-rw-r--r-- 1 owner owner 11K Aug 24  2019 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_war_cry.ogg
-rw-r--r-- 1 owner owner 8.0K Aug 24  2019 ./mods/codermobs/codermobs/sounds/codermobs_mdskeleton_attack.2.ogg
Poikilos commented 3 years ago

There is an update to issue 406: it has nothing to do with audio.

Poikilos commented 3 years ago

This is resolved in bucket_game 211111.

Poikilos commented 8 months ago

Regression occurred 2024-03-01 or earlier