Created
February 10, 2023 18:29
-
-
Save Bejofo/a43f7f73bcc8697926a8aa564bbee15f to your computer and use it in GitHub Desktop.
This file contains 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
# script for ripping audio out of gamemaker audiogroup | |
in_file = open("./audiogroup1.dat", "rb") # opening for [r]eading as [b]inary | |
data = in_file.read() | |
start = data.find(b"OggS")-4 # not exactly reliable | |
idx = 0 | |
while True: | |
size = int.from_bytes(data[start:start+4],'little') | |
f = data[start+4:start+4+size] | |
print(f"test{idx}.ogg - size:{size}") | |
with open(f"./test{idx}.ogg","wb") as new_file: | |
new_file.write(f) | |
idx+=1 | |
start = data.find(b"OggS",start+size)-4 | |
if start <= 0: | |
print("EOF") | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment