From ae411d21b1715a2835f21270e805427633dbe690 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Mon, 14 Oct 2024 23:29:47 +0000 Subject: 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 --- testxml/testxml.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'testxml/testxml.py') 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) -- cgit v1.2.3-70-g09d2