HydrogenAudio

Lossless Audio Compression => Lossless / Other Codecs => Topic started by: VonOben on 2017-08-17 20:19:55

Title: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: VonOben on 2017-08-17 20:19:55
Hi.

I'm looking for a codec that's suitable to compress the audio of old computer tapes. I have an audio file that is generated, so it's flawless in terms of noise. I will be using some device (a phone most likely) to play this audio file to a retro computer instead of using it's ageing tape player.

A small mono wav-file is 1705kB, flac can compress it down to 688kB. 7z can compress the wav to 5kB! The flac-file can be compressed down to 25kB with 7z. (There are around 1kB of actual computer data in the audio file.)

I understand that this is a very specific scenario when it comes to audio encoding. Are there any other codecs that are more suited for these tasks?

If not, does anyonw know any Android player that transparently can decompress a 7z and play the wav inside it on the fly?

Thanks.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: itisljar on 2017-08-17 20:34:21
You can try other losless codecs, like Monkey's Audio or Wavpack. But, I've seen people had compressed C64 tapes in mp3 format and loading them from portable CD player through some kind of interface, replacing cassette player.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: bryant on 2017-08-17 20:37:15
This may not be applicable to your situation, but the most straightforward way to accomplish this would be to port the utility that generates the wav file from the computer data, and then simply have Android generate and play the audio on-the-fly from the original data you want to transfer. Of course, this assumes you have the source code and programming skills.

Otherwise, WavPack lossy might be a good choice because it leaves the waveform unaltered. Regular lossy codes based on human hearing models are probably not recommended.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: splice on 2017-08-17 22:19:40
Most audio tape-based computer data formats (record and play on standard audio tape deck) are designed to work with limited frequency response and low SNR, speed variations, and phase shifts. They typically only need telephone grade bandwidth and SNR (4 KHz bandwidth, 40-55 dB SNR). You could use a lower sample rate such as 11 or 8 KHz / 8 bit.
Do consider the playback mechanism, though. It's no use using 8/8 format, or some specialised codec format, if the playback device doesn't support it.
Personally, I'd use MP3 encoding.  About 10 years ago I had to record the training sequence and data stream of a 2400 bps modem and send it to an overseas lab. I recorded it at 16/44.1 mono and converted to 128 Kbps MP3. The lab had no difficulty playing it into their analyser. I just now took one of the original files and compressed it with LAME at quality 9 (VBR, 45-85 Kbps) for a 20:1 reduction.  Overlaying the input and output waveforms shows an almost perfect match.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: Klimis on 2017-08-17 22:21:31
Your best bet is to research a way to store the demodulated data into a player that will remodulate it back and output the signal. There are some mobile apps that do that but I don't remember their names etc. They store the actual data carried on the audio part but they are saved as data and not audio, which should be some KB of data and upon demand they will modulate the file and play it back from their headphone jack. If I'm not wrong asciiexpress.net online portal actually works that way.

I could help more if I knew exactly for what system you try to achieve this.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: VonOben on 2017-08-18 00:00:15
This is for Commodore 64, I'm using a 90s cassette-to-line-in-adapter in the tape player, and it works really well.

And 622kB instead of 1705kB (A tape turbo) is of course no big deal. But it somehow hurts deep inside when I know 7z makes it 5kB. :D

I found this: http://www.foobar2000.org/components/view/foo_unpack_7z

... but alas, foobar mobile don't seem to have support for add-ons.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: VonOben on 2017-08-18 00:07:51
Yea. I guess I should stop looking, and use this... https://play.google.com/store/apps/details?id=co.kica.tapdancer
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: polemon on 2017-08-18 00:36:12
I'm looking for a codec that's suitable to compress the audio of old computer tapes.

Took me a couple tries understand what you need, but the nail finally dropped: you mean something like the audio from Datasette tapes, like for a C64 and a PET, correct?

If that's the case, I remember a dude at some Demo party had a similar system. In case it's the Datasette it's a little tricky because it doesn't use sines for '0' and '1', instead it writes square waves directly onto the tape. He used some sort of App on his phone to generate the files on the fly. I.e. the files were in binary form, and the App would generate the tones and output them through the headphone jack.

Another dude I know keeps the files as MP3s, because the SNR of those tapes wasn't exactly superb to begin with. Especially the tape machines were kinda low-range, etc. He just plays them back on his phone and it works every time. Even with C64 "Turbo Tapes".

So for archival reasons, having binary versions of the information is probably the best way to go, for quick playback from a phone, just go with the most convenient audio format.

EDIT: Just in case anyone cares, the binary files were tiny, even though they were uncompressed. A couple kilobytes at most. I'm guessing that if you'd use anything else but a stream compressor like xz or lz77, you'd get so much overhead it wouldn't even be worth doing.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: Klimis on 2017-08-18 12:07:51
Yea. I guess I should stop looking, and use this... https://play.google.com/store/apps/details?id=co.kica.tapdancer
That was exactly what I would recommend.
Title: Re: Recommened codec for computer tape audio? (Flac: 688kB, 7z: 5kB)
Post by: polemon on 2017-08-18 16:10:15
Yea. I guess I should stop looking, and use this... https://play.google.com/store/apps/details?id=co.kica.tapdancer
I'm not sure if the dude I've met uses this exact app, but the concept is the same. I'd also recommend this.