Created
November 2, 2011 22:40
-
-
Save lkraider/1335175 to your computer and use it in GitHub Desktop.
GTA Vice City ADF to MP3 audio converter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
def adf2mp3(input_path, output_path, buffer_size=1024*1024): | |
print 'Converting', output_path | |
input_file = open(input_path, 'rb') | |
output_file = open(output_path, 'wb') | |
for read_buffer in iter(lambda: input_file.read(buffer_size), ''): | |
output_buffer = (chr(ord(b) ^ 0x22) for b in read_buffer) | |
output_file.writelines(output_buffer) | |
sys.stdout.write('.') | |
sys.stdout.flush() | |
input_file.close() | |
output_file.close() | |
print '[Done]' | |
if __name__ == '__main__': | |
if len(sys.argv) <= 1: | |
print 'Usage: %s filename.adf' % sys.argv[0] | |
sys.exit(1) | |
adf_file = sys.argv[1] | |
mp3_file = os.path.splitext(adf_file)[0].lower() + '.mp3' | |
adf2mp3(adf_file, mp3_file) |
Hello,
i am a Beginner and want to run this script.
How can i use it?
Thank you very much
UPDATE:
Ok it works. I install Python and run it with IDLE.
Now i have the problem, the converting Data show me 0 Bytes, what i am doing wrong?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This did wonders for me! I love the Emotion station from VC 😄