diff --git a/pop-fe.py b/pop-fe.py index 781ad1c..da3055c 100755 --- a/pop-fe.py +++ b/pop-fe.py @@ -380,6 +380,7 @@ def convert_snd0_to_at3(snd0, at3, duration, max_size, subdir = './'): subprocess.run(['atracdenc/src/atracdenc', '--encode=atrac3', '-i', tmp_wav, '-o', tmp_snd0], check=True) except: print('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\natracdenc not found.\nCan not create SND0.AT3\nPlease see README file for how to install atracdenc\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') + return None print('Converting EA3 to AT3 file') if verbose else None temp_files.append(at3) create_riff(tmp_snd0, at3, number_of_samples=int(len(s['data']['data'])/4), max_data_size=0, loop=True) @@ -878,6 +879,15 @@ def create_psp(dest, disc_ids, game_title, icon0, pic0, pic1, cue_files, cu2_fil True snd0_data = None + if snd0: + # Check if it is already in ATRAC3 format + with open(snd0, 'rb') as s: + buf = s.read(36) + if buf[:4] == b'RIFF' and buf[8:12] == b'WAVE' and struct.unpack_from('