Skip to content

Commit

Permalink
Add Python 3 support (#296)
Browse files Browse the repository at this point in the history
Co-authored-by: GauiPower <[email protected]>
  • Loading branch information
GauiPower and GauiPower authored Oct 5, 2024
1 parent d571692 commit 90004b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions voicetool/voicetool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/bin/env python
#/bin/env python3
#
# compile and decompile Anyka/Chomptech firmware voice files
#
Expand Down Expand Up @@ -30,7 +30,7 @@ def decompile(infilename, outbasename, force=False, quiet=False):
# the number of contained offsets
data = infile.read(4)
first_offset = struct.unpack('<I', data)[0]
num = first_offset / 4 - 1
num = int(first_offset / 4) - 1
offsets.append(first_offset)

# first read all offsets, we read one offset more
Expand Down Expand Up @@ -148,10 +148,12 @@ def compile(inbasename, outfilename, num, force=False, quiet=False):
else:
out = "%s.bin" % args.inputbasename
compile(args.inputbasename, out, args.numwavs, args.force, args.quiet)
else:
elif args.subparser_name == "decompile":
if args.outputbasename:
out = args.outputbasename
else:
out = args.binfile.split(".bin")[0]
decompile(args.binfile, out, args.force, args.quiet)
else:
parser.print_help()

0 comments on commit 90004b5

Please sign in to comment.