Skip to content

Commit 43e018b

Browse files
authored
Upgrade to 0.4.5
Fixed the ADX API usage in the USM file, however it is not tested, it should work as long as the input is valid. Which is now limited to wav and not pure ADX as it used to be, this will be fixed in a planned overhaul.
1 parent 2282446 commit 43e018b

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

PyCriCodecs/usm.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,12 @@ def load_audio(self, audio):
454454
if self.audio_codec == "adx":
455455
if type(audio) == list:
456456
for track in audio:
457-
adxObj = ADX(track)
458-
if adxObj.filetype == "wav":
459-
adxObj.encode(AdxVersion=4, Encoding=3, force_not_looping=True)
457+
wav_bytes = open(track, "rb").read()
458+
adxObj = ADX.encode(wav_bytes, AdxVersion=4, Encoding=3, force_not_looping=True)
460459
self.streams.append(adxObj)
461460
else:
462-
adxObj = ADX(audio)
463-
if adxObj.filetype == "wav":
464-
adxObj.encode(AdxVersion=4, Encoding=3, force_not_looping=True)
461+
wav_bytes = open(audio, "rb").read()
462+
adxObj = ADX.encode(wav_bytes, AdxVersion=4, Encoding=3, force_not_looping=True)
465463
self.streams.append(adxObj)
466464
elif self.audio_codec == "hca":
467465
if type(audio) == list:
@@ -481,9 +479,8 @@ def load_audio(self, audio):
481479
def append_stream(self, audio):
482480
assert type(audio) != list
483481
if self.audio_codec == "adx":
484-
adxObj = ADX(audio)
485-
if adxObj.filetype == "wav":
486-
adxObj.encode(AdxVersion=4, Encoding=3, force_not_looping=True)
482+
wav_bytes = open(audio, "rb").read()
483+
adxObj = ADX.encode(wav_bytes, AdxVersion=4, Encoding=3, force_not_looping=True)
487484
self.streams.append(adxObj)
488485
elif self.audio_codec == "hca":
489486
hcaObj = HCA(audio, self.key)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="PyCriCodecs",
6-
version="0.4.4",
6+
version="0.4.5",
77
description="Python frontend with a C++ backend of managing Criware files of all kinds.",
88
packages=["PyCriCodecs"],
99
ext_modules=[Extension('CriCodecs', ["CriCodecs\\CriCodecs.cpp"], include_dirs=[os.path.realpath("CriCodecs")])]

0 commit comments

Comments
 (0)