Skip to content

Instantly share code, notes, and snippets.

@reidrac
Created July 10, 2018 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reidrac/525be9317ad7a3461100999fc64aa1f9 to your computer and use it in GitHub Desktop.
Save reidrac/525be9317ad7a3461100999fc64aa1f9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
"""
We all have seen some memes about how long did it take to load games from tape
in the old 8-bit microcomputers. 30 minutes, lol. Well, not really (or at least
not for the speccy and the CPC; sorry, no C64 data).
This is not very scientific, as it doesn't take into account multi-load,
turbos, anti-copy, etc; but look at the times and you get the idea.
Requires Python 3 and tape2wav from fuse-tools.
Juan J. Martinez (@reidrac)
Examples (file duration)
*ZX Spectrum*
ROBOCOP1.TAP 0:10:41.031020
URIDIUM.TAP 0:04:32.815057
NEBULUS.TAP 0:04:24.440091
STARGLDR.TAP 0:04:44.582313
*Amstrad CPC*
(a cdt is really a tzx)
Super Cauldron (UK,F,G) (1993) [Original] [TAPE].cdt 0:10:49.402177
Mission Elevator (UK) (1986) [Original] [TAPE].cdt 0:07:04.570091
Stormlord (UK) (1989) [Original] [TAPE].cdt 0:04:56.016417
AMC - Astro Marine Corps (UK) (Face A) (1989) [Original] [TAPE].cdt 0:06:33.826236
"""
import sys
import os
import wave
from datetime import timedelta
from subprocess import call
def main():
if len(sys.argv) != 2:
print("tapelen <file>")
return
filename = sys.argv[1]
wav = filename + ".wav"
try:
call(["tape2wav", filename, wav])
with wave.open(wav, "r") as wd:
print(filename, timedelta(seconds=float(wd.getnframes()) / wd.getframerate()))
finally:
os.unlink(wav)
if __name__ == "__main__":
main()
#!/usr/bin/env python3
"""
We all have seen some memes about how long did it take to load games from tape
in the old 8-bit microcomputers. 30 minutes, lol. Well, not really (or at least
not for the speccy and the CPC; sorry, no C64 data).
This is not very scientific, as it doesn't take into account multi-load,
turbos, anti-copy, etc; but look at the times and you get the idea.
Requires Python 3 and tape2wav from fuse-tools.
Juan J. Martinez (@reidrac)
Examples (file duration)
*ZX Spectrum*
ROBOCOP1.TAP 0:10:41.031020
URIDIUM.TAP 0:04:32.815057
NEBULUS.TAP 0:04:24.440091
STARGLDR.TAP 0:04:44.582313
*Amstrad CPC*
(a cdt is really a tzx)
Super Cauldron (UK,F,G) (1993) [Original] [TAPE].cdt 0:10:49.402177
Mission Elevator (UK) (1986) [Original] [TAPE].cdt 0:07:04.570091
Stormlord (UK) (1989) [Original] [TAPE].cdt 0:04:56.016417
AMC - Astro Marine Corps (UK) (Face A) (1989) [Original] [TAPE].cdt 0:06:33.826236
"""
import sys
import os
import wave
from datetime import timedelta
from subprocess import call
def main():
if len(sys.argv) != 2:
print("tapelen <file>")
return
filename = sys.argv[1]
wav = filename + ".wav"
try:
call(["tape2wav", filename, wav])
with wave.open(wav, "r") as wd:
print(filename, timedelta(seconds=float(wd.getnframes()) / wd.getframerate()))
finally:
os.unlink(wav)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment