diff options
author | Fedja Beader <fedja@protonmail.ch> | 2024-10-14 23:29:47 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2024-10-14 23:29:47 +0000 |
commit | ae411d21b1715a2835f21270e805427633dbe690 (patch) | |
tree | fffdf374478ad2c9a650c9cbfcceb20747ddd696 | |
parent | 252bf653d043e01e639e768ce308384e68653ae8 (diff) | |
download | tools-ae411d21b1715a2835f21270e805427633dbe690.tar.gz tools-ae411d21b1715a2835f21270e805427633dbe690.tar.bz2 tools-ae411d21b1715a2835f21270e805427633dbe690.tar.xz tools-ae411d21b1715a2835f21270e805427633dbe690.zip |
Switch from obsolete ogg.vorbis library to python-soundfile
pyvorbis is no longer available after debian Buster.
Associated clientdata pipeline: https://git.themanaworld.org/specing/clientdata/-/commits/test_testxml_update
Requires packages updated in clientdata as in that branch. Perhaps better to shift .tools/testxml.sh into tools repo.
Squashed with:
* Remove other method left commented out and untested
* Why specify specific exception type when we can just handle them all?
* Alright, ancient (10.1-3) SoundFile lib has no SoundFileError yet
****
ml/tools!3
-rwxr-xr-x | testxml/testxml.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py index 6252847..f3d87b0 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -10,7 +10,7 @@ import re import datetime import xml import csv -import ogg.vorbis +import soundfile import StringIO import sys from xml.dom import minidom @@ -938,8 +938,10 @@ def testSound(file, sfxDir, msg): showMsgFile(file, "sound file not found", True) return try: - ogg.vorbis.VorbisFile(fullPath) - except ogg.vorbis.VorbisError as e: + # TODO: speed this up by preallocating a numpy array? + soundfile.read(fullPath, always_2d = False) + #except SoundFileError as e: + except Exception as e: showMsgFile(file, "sound file incorrect error: " + str(e), True) |