Skip to content

Commit

Permalink
Add options
Browse files Browse the repository at this point in the history
--volume, --mode
  • Loading branch information
KOZ39 committed Jul 13, 2018
1 parent 54a5488 commit 64df82a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
acb2wav.exe [Options]
Options:
-v, --version show version and exit
-V, --version show version and exit
-k, --key Default: 00003657f27e3b22
-v, --volume Default: 100
-m, --mode Default: 16
-e, --extension Default: acb.bytes
-i, --inputDir Default: acb
-o, --outputDir Default: wav
Expand Down
6 changes: 4 additions & 2 deletions src/acb2wav.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def remove_words(str, *words):

parser = argparse.ArgumentParser()

parser.add_argument("-v", "--version", action="store_true", help="show version and exit")
parser.add_argument("-V", "--version", action="store_true", help="show version and exit")
parser.add_argument("-k", "--key", metavar="", default="00003657f27e3b22", help="Default: 00003657f27e3b22")
parser.add_argument("-v", "--volume", metavar="", type=int, default=100, help="Default: 100")
parser.add_argument("-m", "--mode", metavar="", type=int, default=16, help="Default: 16")
parser.add_argument("-e", "--extension", metavar="", default="acb.bytes", help="Default: acb.bytes")
parser.add_argument("-i", "--inputDir", metavar="", default="acb", help="Default: acb")
parser.add_argument("-o", "--outputDir", metavar="", default="wav", help="Default: wav")
Expand Down Expand Up @@ -65,7 +67,7 @@ def remove_words(str, *words):

try:
with open(os.path.join(dir_name, f"{track_name}.wav"), "wb") as f:
f.write(d.decode(i.binary.read()).read())
f.write(d.decode(i.binary.read(), args.volume/100.0, args.mode).read())

print(f"{track_name}.wav")
except hcapy.InvalidHCAError:
Expand Down

0 comments on commit 64df82a

Please sign in to comment.