Introduction: Storing Files on an Audio Cassette
This will show you how to store any type of file on an audio cassette. Depending on whether you modify the cassette recorder or not, you can get around 1.5 megabytes on a tape. I can get this much space because I increased the speed of the motor inside the recorder to its maximum by jamming a piece of tin foil in the hole at the back of the motor. I also change the sample rates in Audacity to 132300Hz which lets me write the files to the tape much faster. When I record the files, they are recorded at 132300Hz and then the rate is set to 22050 to slow it back down to the rate at which the program can decode it. These modifications are not needed though if you are just experimenting with small files.
You will need:
A cassette recorder with a line in or microphone socket
KCS08 an old program which converts the file into sound for storing. I can not find this program on line anywhere now so I have uploaded it here.
Here is a website with a detailed description of the software:
ftp://ftp.taygeta.com/pub/forth/compilers/native/dos/DXForth/kcs08.txt
The picture of the program will show you what parameters are available.
Audacity
http://audacity.sourceforge.net/
An audio cable to connect the cassette recorder to the line in socket on the computer
Attachments
Step 1: Encoding Files to Wav
In the attached zip file on the intro, you will find the program. To encode the included bitmap image, simply double click on encode.bat. The program will then create a wav file.
To edit the batch file, right click it and select edit.
Here is what is currently in the file:
KCS -M -Y -U -L5 1.bmp 1.wav
To encode something with a different name or extension, change the 1.bmp which is the input file, and 1.wav which is the output file to a file name of your choice.
Step 2: Recording the Wav Files to Tape.
Open the wav file with Audacity and set the system volume to full. Connect the earphone socket from the computer to the line in on the cassette recorder. Press record and wait a few seconds. Press play in Audacity and wait until the file ends. Stop the recorder a second after the file ends.
Step 3: Reading and Decoding the Files
To get the files off the tape, you need to connect the earphone socket on the cassette recorder to the line in or microphone socket on the computer. Once you have done this, go into the sound properties in the volume control in Windows and select your recording device. Once you have the settings open, select listen to this device in the listen tab. Set the project rate in Audacity to 22050, Rewind the tape, press record in Audacity and press play on the cassette recorder. Adjust the cassette recorder volume until it is near the top of the sound trace in Audacity. Do not make it too high. After adjusting the volume, rewind the tape, discard the current recording and record the whole thing into Audacity at the same level. Once done, save it as a wav file under the same name as is in the batch file. In this case it is 1.wav. Run decode ignore errors.bat and wait while it decodes. Once it is done, you should see your output file in the same folder as KCS08.
Here is what is inside decode ignore errors.bat
Just change 1.wav and 1.bmp to names of your choice.
KCS -Y -U 1.wav 1.bmp
42 Comments
Question 2 years ago
When I try to encode a file is says 1.WAV create error. Can anybody help me?
Question 2 years ago
How do I edit the encode.bat file in dosbox to change the input file type?
3 years ago
For those who have a problem:
The program is for a 16-bit machine so you need an emulator like DOSbox.
To decode it, the file has to be 8-bit (With audacity, Export -> other uncompressed files
-> WAV - unsinged 8-bit PCM)
3 years ago
That KCS08 program is total garbage. Doesn't even run on 64-Bit Windows, which most people run.
Tip 3 years ago
Hello,
I made some very simple modifications to the code, so It's easier to work with it. I added an additional program into the folder I'm starting KCS from called "EditVar and Choose".
I created files E.bat and D.bat (so it's easier to start them), and I did the following:
In file E.bat:
@echo off
editvar -p "Input file: " in
editvar -p "Output WAV: " out
KCS -M -Y -U -L5 %in% %out%
In file D.bat:
@echo off
editvar -p "Input WAV: " in
editvar -p "Output file: " out
KCS -Y -U %in% %out%
Now I don't have to edit the encode and decode files every time, I just run them and easily enter the filenames.
If you want to have the input and output files sorted in other folders, simply add a relative path before the variable (for example: output_folder/%out%).
3 years ago
Decided to try this as an experiment this afternoon, took a couple hours to work out some issues but in the end it worked. My test file was a ZIP file (9KB) which contained a PNG image and a PHP script within. No issues generating a WAV file or recording to tape (Panasonic SA-PM193 Recorder; TDK D90 Cassette). The issues I ran into were related to recording clean, loud audio from my tape recorder to the PC. My microphone/line-in input (Sound Blaster Z) did not behave correctly due to some driver-based or hardware noise cancellation that I could not disable. So instead of using my Sound Blaster Z I connected a Hauppauge USB-Live 2 and used the left audio RCA input to record from tape. This almost worked (was able to partially decode with some errors) but it wasn't until I ran a high-pass filter and normalization to 0db (also removed DC offset) before I was able to fully decode the WAV with zero errors. Opened up the ZIP and both files looked fine upon inspection. I also did a SHA-1 checksum and it was identical for the original ZIP and restored ZIP. Woohoo! Thanks for a fun journey and look back at what passed for data storage back in the day!
4 years ago
Okay, a little update – I bought and repaired an old cassette player, but couldn't get KCS to work with a real cassette. The signal I got from a real tape looks pretty darn good, I easily could've decoded it visually: https://i.imgur.com/S8XKvex.jpg
But that KCS program is just HORRIBLE rubbish, this time it has everything it needs – I've converted the file to proper 8 bit 22.05 kHz, but this piece of crap finds like 8000+ errors reading a file. Maybe it's because speed is a little different, but losing 0.3 secs every minute seems to be almost perfect for an analog player.
I got no idea what to do now, it just doesn't work. Wonder if people had such problems back in the day storing programs on tape. :(
5 years ago
any way do decrease bits per second i can never get it to work in any other way than decoding the generated wav file but even something like loopback that would have better quality than a cassette doesnt decode
Reply 5 years ago
ok i fixed all problems it was audacity not properly converting to 8 bit sound and alsoit seems to store data in a extremely sped up morse code from what i can tell
Reply 4 years ago
I have the same problem, could you tell me how to fix it?
Reply 4 years ago
Check out my 2 comments, I've just got this actually working. :)
4 years ago
Hello I was recorded in a tape but the sound is bad and I wasn't can decode, I was recorded in to audacity using a Jack connection between my phone and the PC the quality is perfect, but I can't decode the file audio. Help me please. Sorry I don't speak English.
Reply 4 years ago
Check out my 2 comments, just got this this sucker working. :)
4 years ago
Oh wait!!!
I've... I've just figured it out! AAAAAAAAAAAAAAA!!! :DDD
Ok, so to those who'll be struggling after me – nowhere in the article it's mentioned that you need to feed that stupid KCS program with exactly, and literally nothing else but an 8-bit Mono Wave file. On the Audacity screenshot it says "32-bit float", but that's a lie – Audacity shows any file as "32-bit float", even if it's a proper 8-bit mono.
So, what I did is recording audio over Audacity(via audio cable), cutting the "tails" so the file would start and finish with that "beeeeeep", and then converting it to 8-bit mono 22050 Hz with Weeny Free Audio Converter(cause Audacity can't convert to 8-bit).
It finally worked, providing me with that .bmp bacteria sized audio cassette picture from the original folder.
Haven't tried recording to a real cassette cause the last time I've had a cassette player was 15 years ago. :)
Maybe I'll try it somewhere in the future.
Hope my little comment will help somebody – wish it was here before I spent 3 hours dicking around with this stuff. xD
P.S. Actually it says in the manual to the program that:
==========================================
The audio file MUST be an 8-bit mono file recorded at 22050
samples per second. Any other format will result in failure.
==========================================
^ This developer guy know what he's talking about. :)
4 years ago
That's total trash, I recorded the original 1.wav file directly over an audio cable back to my PC, the waveform looks almost as perfect as on the generated file – you'd never be able to record nearly as good from a real cassette tape: https://i.imgur.com/tgDlWwl.jpg
But still, the software pretty much fails all the time at decoding, whatever you do – I even tried playing with equalizer for an hour or so...
That's definitely not a reliable way to store information, or at least decoding it back to digital state. I'm completely sure that KCS program was never even tested with a real audio tape.
P.S. To those struggling to launch the program – it's meant to be used with a DOS machines, can easily be run in DOSBox.
7 years ago
wouldnt speeding up the cassette make less storage
Reply 4 years ago
Here's the thing, audio cassettes (and every other tape) has a frequency response (how high a frequency can go) defined by how fast the tape is moving past the tape head. This is why VCRs have spinning heads, so they can achieve a ~3 MHz frequency response rate necessary for video. This relates to us here because the data may be encoded using a higher frequency than a normal tape. therefore, speeding up the tape makes the frequency response higher. Alternatively, you can slow down the audio file before recording to lower the frequency of the data, then record it at normal speed.
Reply 7 years ago
because the faster the tape is the farther apart the bits are
6 years ago
If any of you self proclaimed "old timers" really know about old computers, you would know that the old IBM computers used punch cards and punch tape. Cards can hold about 1 kb per 300 or so cards and read/write speeds are about 10 bytes per second. Tape could read/write at roughly 2 bytes per second and since most tape was reeled up in spools of about a 1000 yards so maybe you can fit a kilobyte on a reel of tape.(which by the way, was 100 pounds.)
Reply 4 years ago
Lets break this comment down a little bit. Starting with the 1Kb stored per 1000 yards claim. Given that 1Kb is 1024 bytes, that would mean it took nearly 1 yard of tape to store 1 byte! I'm not sure if you have ever seen a punched tape or not, but the holes are generally lined up 8 across and tape is about 1 inch wide. That means you can actually fit about 8 bytes per inch of tape, or 96 bytes per foot, or 9600 bytes per 100 feet. 1Kb per 1000 yards debunked.
The card claim 1Kb per 300 cards is just as dubious, the most common were 80 or 96 columns. We will use the 80 c olumn card for comparison. Each column was 1 byte so you had 80 bytes per card, 800 bytes per 10 cards, and 8000 bytes per 100.
Let's talk about speed paper tape. Those could be read a speeds of 1000+ bytes per second, though punching was slower, that is far from the claimed 2 bytes per second. Cards can be read a similar speeds. See Wikipedia for some real stats https://en.wikipedia.org/wiki/Punched_tape.
And as for weight, the reels of paper tape were typically the same size as a ream of paper (though a bit thinner). So I have trouble believing it was 100 lbs per reel. In fact, I had my hands on a paper tape puncher/reader, and 5 reels of tape, and the whole thing was less than 30 lbs.
So really, all these claims are bogus.