Grand Theft Auto: Vice City

Grand Theft Auto: Vice City

Not enough ratings
Extracting music
By obamafish
Extracting them radios
   
Award
Favorite
Favorited
Unfavorite
The script.
#!/usr/bin/env python3

import os, sys

chunk_size = sys.int_info.sizeof_digit

magic = [0]
for i in range(chunk_size):
magic.append((magic[i]) << 8 | 0x22)

for radio in [f for f in os.listdir('.') if f[-3:].lower() == 'adf']:
print('Converting {}... '.format(radio), end = '', flush = True)
with open(radio, 'rb') as adf, open (radio[:-3] + 'mp3', 'wb') as mp3:
while True:
chunk = adf.read(chunk_size)
if not chunk:
break
bytes_read = len(chunk)
new_chunk = (int.from_bytes(chunk, sys.byteorder) ^ magic[bytes_read]).to_bytes(bytes_read, sys.byteorder)
mp3.write(new_chunk)
print('OK', flush = True)

Just copy the script into the audio directory and run it with Python 3 installed. It will do the bitwise XOR on every byte in the file, turning them into normal MP3s.

I feel this would have won the honorable "the most unnecessarily bloated, redundant and slow code" award, had it not been so uninspiring. But oh well.
Is that a bunny in a bucket?
Yes, it is indeed a bunny in a bucket. Or a flower pot. But flower pots are also kinda like buckets.
2 Comments
obamafish  [author] 23 Dec, 2016 @ 5:00pm 
You just make sure you have Python 3 installed, put it in the Audio directory and run it. It will convert the ADF files that contain the radio music into normal MP3s.
False Christian 1 Oct, 2016 @ 8:12am 
That is a complex-looking piece of code (I use Qbasic, LOL!!!). From what can you extract mp3's from? Thank you.